Rebuild as a dialect-independent schema representation - #7
Merged
Conversation
Replaces the R7-era proof of concept with an S7 representation of a relational schema -- tables, columns, types, constraints and indexes -- together with the protocol that dialect packages implement. Rendering a schema is not rendering each table in turn. Foreign keys can form cycles, so tables are emitted in dependency order and any foreign key closing a cycle is hoisted into a trailing ALTER TABLE. Engines without ADD CONSTRAINT opt out through sqlr_defers_constraints(). Comparison is structural: constraints and indexes are matched on what they constrain rather than on their order or their names, so a schema authored here compares equal to the same schema read back out of a database that chose its own constraint names. Dialects dispatch on a dialect object rather than on a connection, which keeps this package free of database dependencies and lets the whole suite run with no server.
nbenn
marked this pull request as ready for review
August 28, 2026 15:19
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
Remotes: RConsortium/OOP-WGpin resolves to nothing now that R7 has become S7, so the package could not be installed at all.ALTER TABLE. Engines with noADD CONSTRAINTopt out throughsqlr_defers_constraints().nbenn/sqlr.postgresandnbenn/sqlr.sqlite, where a render/execute/reflect round trip is asserted against a real engine.There is no issue to close — this came out of a design discussion, so no
Fixestrailer. Say the word if you would rather it hung off one.