Fun fact, I have to think VERY hard before typing ‘peak’ vs ‘peek.’
Today I want to highlight some of the language server protocol support build into our VS Code extension for the SQL and PL/Language, specifically –
Go to Declaration
This one is pretty obvious, you have some Oracle database code (SQL or PL/SQL), and you want to go look at the object being referenced in your code.
The simplest example would be something like –
select * from hr.employees;
So let’s do it –
Alright, now let’s try something a bit more interesting.
From inside my HR.ADD_JOB_HISTORY() procedure, I want to go look at my JOB_HISTORY table.
My INSERT statement isn’t schema qualified. It just says to
INSERT INTO job_history (empl...
So, when we ask our editor to open JOB_HISTORY, we search for objects called JOB_HISTORY, and if there’s more than one, we give you a list.
We have a list of objects in the database, shown or represented as ‘files,’ and they’re organized on the:
- connection, HR
- schema, HR, HRREST, OE
- object type, TABLE, TABLE, SYNONYM
Click one one, and the full metadata are displayed on the left. But double-click here, and we’ll open the object for you.
There’s probably a better way to display this metadata to SQL and PL/SQL developer, but for the moment this is what we came up with. I’d love to hear if you’ve seen other extensions find a better way of doing this, or if you have any suggestions!
You can use the js Fetch command to run things like…REST APIs.
What’s that look like?
Now if I want to get more than a peek, I can still double-click on the item on the right, and open my program.