Skip to content

Conversation

mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Sep 24, 2025

This adds a completion info (unstyled for now) to the table completion.

Also

  • utilities for building the SQLNamespace
  • include default DB in name (not just the tables)
image

More images

Screenshot 2025-09-25 at 11 20 42 AM Screenshot 2025-09-25 at 11 19 48 AM Screenshot 2025-09-25 at 11 19 04 AM Screenshot 2025-09-25 at 11 19 00 AM

Copy link

vercel bot commented Sep 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Sep 25, 2025 8:58pm

"name",
"email",
],
"children": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these snapshots changed for two reason:

  1. instead of just labels, it now includes a custom Completion with a info render
  2. We also include default databases at the top (previously did not). that can be see in this commit: 780202d#diff-f79af3635ef377d486695e4101902aad0982c208b769b3851c9086e694f722f3


// Otherwise, we need to use the fully qualified name
for (const database of connection.databases) {
if (database.name === defaultDb?.name) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only functional change. we now include the default db which can help with autocomplete or if users want fully qualified names

@mscolnick mscolnick marked this pull request as ready for review September 25, 2025 15:52
@Light2Dark
Copy link
Contributor

Light2Dark commented Sep 25, 2025

some style edits, I think it's great overall!

CleanShot 2025-09-26 at 04 51 55 CleanShot 2025-09-26 at 04 55 58

I looked at overriding the tooltipRenderer to work with this, but may need some change to codemirror-sql, maybe make it async for something like this

            tooltipRenderers: {
              table: (data: NamespaceTooltipData) => {
                return await data.item.completion?.info().dom.outerHTML
              },
            }

@mscolnick
Copy link
Contributor Author

I looked at overriding the tooltipRenderer to work with this, but may need some change to codemirror-sql, maybe make it async for something like this

Yep, i already made these changes to codemirror-sql, so we can use them when we upgrade

@mscolnick mscolnick merged commit ff2ca9a into main Sep 25, 2025
25 checks passed
@mscolnick mscolnick deleted the ms/sql-completions branch September 25, 2025 21:11
@mscolnick mscolnick added enhancement New feature or request includes-media Description includes multimedia provided to illustrate functionality. bash-focus Area to focus on during release bug bash labels Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bash-focus Area to focus on during release bug bash enhancement New feature or request includes-media Description includes multimedia provided to illustrate functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants