cmoog / vscode-sql-notebook

Open SQL files as VSCode Notebooks.
https://marketplace.visualstudio.com/items?itemName=cmoog.sqlnotebook
MIT License
123 stars 16 forks source link

How to specify SSL options? #7

Closed ryan6416 closed 2 years ago

ryan6416 commented 2 years ago

image

cmoog commented 2 years ago

Ah, good catch. I'll add a boolean option for SSL in the connection setup flow. Will release v0.2 once that merges.

cmoog commented 2 years ago

Upon further inspection, it appears some drivers expose additional SSL configuration that would significantly bloat the prompt-based connection configuration flow. Even though it's tempting, I'm trying to avoid requiring a yaml configuration on the filesystem. I've also ruled out using the extension settings to configure connections as that wouldn't be an appropriate usage and would complicate secret storage. Sadly, vscode virtual files are read-only so that won't work either.

@ryan-efendy any thoughts on how this should be supported?

navimondo commented 2 years ago

Charlie and contributors: keep up the great work 😉 Finally I have an SQL scratchbook that I can share with the colleagues and store in the version control. This issue is a little bit different but similar to the SSL settings, so I am adding it as a comment. The Azure SQL connection requires the "encrypt" flag to be set to True. I could not find a way to tell the SQL Notebook connection manager to enforce the "encrypt" flag. This results in following error:Error running command sqlnotebook.connect: Server requires encryption, set 'encrypt' config option to true.. This is likely caused by the extension that contributes sqlnotebook.connect. Hopefully there is an easy way to add Encrypt=True to the connection string

cmoog commented 2 years ago

Thanks @navimondo! Glad you're finding it useful.

I'm working on abstracting the configuration webview form to generic driver configurations so we can solve this problem categorically for all drivers and all configuration options in a clean way. In v0.3.0, you'll have the ability to set encrypt: true through a checkbox when creating new connections.

navimondo commented 2 years ago

Implemented a quick and dirty workaround by editing the "driver.js" file ...\.vscode\extensions\cmoog.sqlnotebook-0.2.0\out\extension\driver.js By changing the encrypt argument to true and restarting VS Code, the driver connects 😮 Thanks to open source 🐱‍🏍 SQL Notebook - AzureSQL Thanks for giving us an easy to customize database status dashboard.

cmoog commented 2 years ago

The configuration option for mssql is now available in v0.3.0. I've opened a follow-up issue for the remaining drivers #14