Split the API into /clickhouse and /postgres entries with one table - #21
Merged
Merged
Conversation
Each database gets one import that covers it: the whole query builder plus that dialect's column types, functions, table DDL and compile. The root entry and /types are removed. `table` is now the only way to declare a table, and it carries its DDL (CH.table with engine and keys, PG.table with primary key, indexes and foreign keys). The plain table(name, columns, options) is gone from the public API; insert typing comes from column options. `external: true` covers what the schema does not own: system tables, table functions, subqueries and tables another tool migrates. It has no DDL, so generate skips it. /schema keeps only the migration tooling. Docs, reference catalog and checks are updated for both entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (72)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Each database now has one import that covers it, drizzle style:
Each entry exports the whole query builder (
from,param,insertInto,unionAll, …) plus that database's column types, functions, table definitions and acompilethat defaults to its dialect. Postgres code never importsCH.Breaking changes
@maple-dev/effect-ormentry and/typesare gone.tablenow carries its DDL. A ClickHouse table takes an engine and keys; a Postgres table takes a primary key, indexes and foreign keys. The plaintable(name, columns, { tenantColumn, defaults, computed })is gone from the public API.column(type, options), not from table options.S.defineTable,S.column,S.engine,S.index,S.materializedViewandS.ttlAfterDaysmove to/clickhouse.S.pg.*moves to/postgres./schemakeeps only the tooling: rendering, snapshots and the diff.computedoption was the only way to mark one read-only.New
table(name, { external: true, columns })declares something the schema does not own: system tables, table functions, subqueries, or tables another tool migrates. It queries like any table, carries no DDL (sogenerateskips it) and writes its name verbatim as the FROM target.Docs and checks
docs/reference.mdare rewritten for the two entries.check-exports-documentednow covers both entries.check-packagenow checks the new entry points.Test plan
bun run typecheckbun run test: 615 passed, 195 skipped; doc citations, export catalog and doc examples all passbun run test:package: the packed tarball passes for imports, types, compilation and codecsbun run test:clickhouseagainst a live server🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.