Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

CodeLens Buttons to Run SQL #118

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

CodeLens Buttons to Run SQL #118

wants to merge 7 commits into from

Conversation

archiewood
Copy link
Member

@archiewood archiewood commented Jun 22, 2023

  • Shows "Run Query" buttons above SQL codeblocks
  • Prompts to install SQLtools and the correct driver if not installed
  • Returns Query result in Side Panel
  • Povides access to the SQLTools database explorer

SQLTools is not installed

CleanShot 2023-06-22 at 22 23 35

Database Explorer

CleanShot 2023-06-22 at 22 44 57

Inline Queries

CleanShot 2023-06-21 at 21 13 20

File Queries

CleanShot 2023-06-21 at 21 21 05

Chained Queries

CleanShot 2023-06-22 at 22 31 47

Done

  • Smoother connection
    • Read connection info from evidence settings (dont have the configure the connection in 2 places) Done for 1 configuration of Snowflake and BQ only - there is lots of tricky conditional logic to thing about here.
    • Don’t run the query and instead suggest the right driver if the SQLtools driver is not installed
  • Chained queries (will currently fail) as it doesnt compile the SQL with caveat

Outstanding Issues

  • Reading in settings from Evidence. This is a bunch of quite gnarly logic - maybe we should just make the user add the settings themselves.
  • Chained queries are somewhat borked. I am reading in the compiled queries from the file system. They only run correctly if:
    • The user has saved the markdown page
    • The evidence server is running
    • The user has the page with the query in it open in the browser
  • Codelens to pull up database in sidebar?
  • Doesn't auto pick the connection if it exists (rather than the dropdown showing first time)
    • Though this only happens once per session, after which the connection is assumed
  • Rigorous testing
  • No DuckDB SQLTools driver - so the demo project is a bit crippled

@archiewood archiewood changed the title Codelens CodeLens Buttons to Run SQL Jun 22, 2023
@archiewood archiewood marked this pull request as ready for review June 23, 2023 03:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant