Sublime Forum

New package: Oracle

#1

I use Oracle on a regular basis at work, and the built-in SQL syntax definition doesn’t support many Oracle extensions. So I wrote my own.

Oracle at Package Control

Some supported features:

  • Pivot clauses.
  • Recursive queries using connect by.
  • Correct handling of double-quoted identifiers.
  • Highlighting of built-in Oracle functions and constants.
  • Factored subqueries appear in the symbol list.
  • Detailed meta scopes for use with “expand selection to scope”.
  • Hints.
  • Quoted strings with q.
  • A liberal helping of PL/SQL, including package, function, and stored procedure definitions.

Not currently implemented:

  • Many Oracle features.
  • Completions.
  • SQLPlus interface.

Why create a new syntax rather than improving a new one? The default SQL syntax is not designed to support vendor-specific extensions, so adding detailed Oracle support would be inappropriate. There are a couple of third-party Oracle packages, but they are old-style .tmLanguages with limited functionality. With YAML Macros, it became reasonable to implement features like correct handling of double-quoted identifiers that would otherwise be unreasonably verbose. (The compiled files are around 60% larger than the source files.)

This release is early-beta-quality. I’m open to suggestions for improvement. In particular, if you use a piece of Oracle syntax that is not yet implemented, let me know and I will bump it to the top of the list. (Please include a code sample.)

3 Likes

SQL syntax treat # as comment