Skip to content

Instantly share code, notes, and snippets.

@PhilippSalvisberg
Last active October 23, 2024 08:43
Show Gist options
  • Save PhilippSalvisberg/da88ca33990890281e997e0acde04d75 to your computer and use it in GitHub Desktop.
Save PhilippSalvisberg/da88ca33990890281e997e0acde04d75 to your computer and use it in GitHub Desktop.
Wish List for SQLDev's SDK for VSCode

Wish List for SQLDev's SDK for VSCode

The SQL Developer team is planning to release an SDK for their Oracle SQL Developer Extension for VSCode.

This Gist contains a list of features we would like to see in the SDK.

Features

1. Access to Database Connections

  • Query all database connections managed by SQLDev
  • Get all Properties of a connection including status (connected/closed)
  • Set properties of a connection
  • Save a connection
  • Create a new connection
  • Clone a connection
  • Delete a connection
  • Open a connection
  • Close a connection
  • Execute SQL over a connection

2. Editors

  • Get the connection of an editor
  • Set the connection of an editor (including "none")

3. Navigation

Navigate to a database object. Similar to the capabilities provided by the hyperlink column in SQLDev classic SQLDEV:LINK :<object_owner>:<object_type>:<object_name>[:<line>:<col>][:<label>]:<drill_class>.

  • Navigate to the code, optionally specifying the line/code, and open an editor (using the virtual file system for database objects):
    • Function
    • Procedure
    • Trigger
    • Package Spec
    • Package Body
    • Type Spec
    • Type Body
  • Navigate to database objects as if the user were navigating the connection tree
    • Table/Column
    • View/Column
    • Index
    • Package/Element
    • Procedure
    • Function
    • Operator
    • Queue
    • Queue tables
    • Trigger
    • Type/Element
    • Sequence
    • Materialized View
    • Materialized View Log
    • Synonyms
    • Public Synonym
    • Database Link
    • Public Database Link
    • Directory
    • Edition
    • Java
    • JavaScript
    • Job
    • ...

4. Formatter

Variant a) Runtime Access to SQLDev features (not preferred)

The idea is to provide an alternative formatter as extension while keeping the functionality of SQLDev "as is". The user can configure which formatter to use in VS Code (part of the product). Behind the scenes we use SQLDev's formatter with custom settings and a custom Arbori program.

  • Run the formatter with custom settings
    • A list of key/value pairs, similar to "Advanced Format" in SQLDev classic
    • A Arbori program with JavaScript callbacks

Variant b) Formatter Lib Access (preferred)

The problem with variant a) is that the grammar may change with each version of SQLDev and this may break the custom formatter.

To solve this problem, we could bundle specific versions of the JARs containing everything the formatter needs into our own extension. Using libs from Maven Centrel would be perfect, otherwise we would have to grab the right set of libs from a SQLcl distribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment