Namanmahor/plat 428 support for multiple databasesschemas for motherduck by NamanMahor · Pull Request #9641 · rilldata/rill · GitHub
Skip to content

Namanmahor/plat 428 support for multiple databasesschemas for motherduck#9641

Open
NamanMahor wants to merge 10 commits into
mainfrom
namanmahor/plat-428-support-for-multiple-databasesschemas-for-motherduck
Open

Namanmahor/plat 428 support for multiple databasesschemas for motherduck#9641
NamanMahor wants to merge 10 commits into
mainfrom
namanmahor/plat-428-support-for-multiple-databasesschemas-for-motherduck

Conversation

@NamanMahor

Copy link
Copy Markdown
Contributor

Closes PLAT-428: Support multiple databases/schemas for Motherduck

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@NamanMahor NamanMahor requested a review from k-anshul July 2, 2026 12:59
@NamanMahor NamanMahor changed the base branch from main to merge_gettable_and_lookup_of_information_schema July 2, 2026 13:00
@NamanMahor NamanMahor self-assigned this Jul 2, 2026
@NamanMahor

Copy link
Copy Markdown
Contributor Author

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

whereClause = " AND t.table_name ilike ?"
args = []any{ilike}
} else if name != "" {
whereClause = " AND t.table_name = ?"

P1 Badge Append table-name filters to the WHERE clause

When name or ilike is supplied, these assignments replace the WHERE t.table_catalog ... AND t.table_schema ... prefix with a bare AND t.table_name ...; the formatted query places that immediately after the JOIN, so Lookup, filtered All, and any generic DuckDB/MotherDuck write path that calls dropTableUnsafe before creating a table fail with a SQL syntax error instead of finding the table.


if databaseSchema != "" {
whereClause += "WHERE t.table_catalog = ?"
args = append(args, database)

P2 Badge Use the current catalog when only a schema is specified

When a caller sets database_schema without database (for example a metrics view targeting main in the current MotherDuck database), this branch still binds the empty database value to t.table_catalog, so Lookup(ctx, "", "main", name) searches catalog '' and reports the table missing. The catalog predicate should only use the provided database when it is non-empty, otherwise it should fall back to current_database() while still filtering by the requested schema.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@rilldata rilldata deleted a comment from chatgpt-codex-connector Bot Jul 2, 2026
@NamanMahor

Copy link
Copy Markdown
Contributor Author

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9e26d914f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread runtime/pkg/rduckdb/generic.go Outdated
Comment thread runtime/drivers/duckdb/config.go Outdated
Base automatically changed from merge_gettable_and_lookup_of_information_schema to main July 3, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants