Skip to content

quote duckdb tables, schema with double quote#8387

Merged
mscolnick merged 3 commits intomainfrom
sham/fix-quoting-duckdb-tables
Feb 23, 2026
Merged

quote duckdb tables, schema with double quote#8387
mscolnick merged 3 commits intomainfrom
sham/fix-quoting-duckdb-tables

Conversation

@Light2Dark
Copy link
Collaborator

📝 Summary

Closes #8380. Quotes duckdb tables with double-quotes to avoid special characters affecting the query.

DESCRIBE schema.name.table -> DESCRIBE "schema.name"."table"

🔍 Description of Changes

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Tests have been added for the changes made.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Pull request title is a good summary of the changes - it will be used in the release notes.

@vercel
Copy link

vercel bot commented Feb 20, 2026

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 23, 2026 4:41am

Request Review

akshayka
akshayka previously approved these changes Feb 20, 2026
return "unknown"


def _quote_identifier(identifier: str) -> str:
Copy link
Contributor

@mscolnick mscolnick Feb 22, 2026

Choose a reason for hiding this comment

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

do you think it would be better to avoid quoting if possible? (more concise / cleaner) by only quoting when containing special chars? the downside is being smart can always lead to more issues

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it should be safe, https://duckdb.org/docs/stable/sql/dialect/keywords_and_identifiers. We might miss certain special chars imo.

  • Identifiers can be quoted using double-quote characters ("). Quoted identifiers can use any keyword, whitespace or special character, e.g., "SELECT" and " § 🦆 ¶ " are valid identifiers.
  • Double quotes can be escaped by repeating the quote character, e.g., to create an identifier named IDENTIFIER "X", use "IDENTIFIER ""X""".

Copy link
Contributor

Choose a reason for hiding this comment

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

sweet sounds good

@mscolnick mscolnick merged commit a08c7d2 into main Feb 23, 2026
42 of 43 checks passed
@mscolnick mscolnick deleted the sham/fix-quoting-duckdb-tables branch February 23, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DuckDB tables in nested namespaces cannot be described

3 participants