Redesign fluent API with explicit table selection - #193
Merged
Merged
Conversation
Replace ambiguous positional table arguments in the unreleased fluent API with staged expressions: Create/Alter.Column(name).OnTable(table), Delete.Column(name).FromTable(table), and Rename.Column(name).OnTable(table) .To(newName). Apply the same explicit table selection to indexes, named constraints, foreign keys, views, data transfers, and schema reads. - Share column type/options methods across table, create, and alter builders. Keep each column handle bound to its own column and snapshot mutable input. - Split insert/update/delete into builders exposing only supported operations. Require Where, WhereSql, or explicit AllRows for updates and deletes. - Reject unfinished expressions at Build, Apply, and Preview before execution, preserve expression ordering, and reject duplicate completion. - Rename IfDatabase to IfProvider and map AsDateTime to DbType.DateTime, with a distinct AsDateTime2 helper for DbType.DateTime2. - Fix unfiltered updates and scalar reads to select the correct provider overloads; quote table names for scalar reads and unfiltered deletion. - Update README, manual source, generated website/search index, capability inventory, breaking-change guide, and the runnable fluent quick start. - Add regressions for incomplete chains, dispatch, column handles, snapshots, composite foreign keys, quoted names, and SQLite schema/data execution. Validation: - Solution build passed. - Unit suite: 584 passed, zero skipped. - SQLite suite: 306 passed, zero skipped. - Documentation: 106 C# samples compiled and 8 SQLite parity checks passed. - Generated docs, links, anchors, and paired examples verified. - Fluent quick-start preview, migration, and automatic rollback passed. - External database suites were not run locally. BREAKING CHANGE: Remove the old positional fluent overloads and shared data builder. Named fluent columns now require an explicit type; unfiltered update/delete requires AllRows. Existing fluent consumers must adopt the staged methods documented in the migration guide. This API is unreleased.
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.
The unreleased fluent API mixes object names and table names in positional arguments, making migrations hard to read and easy to misconfigure. Replace those overloads with staged expressions that make the target table and the next supported step explicit.
API changes
AllRows().Build,Apply, orPreview, before any queued operation executes. Reject duplicate completion and retain independent snapshots of mutable definitions.IfDatabasetoIfProvider; move table selections toSchema.Table(table).Select(...)/.SelectScalar(...).AsDateTime()map toDbType.DateTime; addAsDateTime2()for the former mapping.Execution fixes and documentation
Correct provider overload selection for unfiltered updates and scalar reads, and quote table names for scalar reads and unfiltered deletion. Add regression coverage for incomplete chains, provider dispatch, column handles, snapshots, composite foreign keys, quoted names, and SQLite schema/data changes.
Update the README, manual sources, generated website and search index, capability inventory, breaking-change guide, and runnable fluent quick start. The quick start now previews, applies, and automatically reverses an added column and index.
This intentionally breaks the unreleased fluent API. The migration guide documents the replacement syntax and behavior changes. This PR is based directly on
masterand contains only the fluent API work.Validation
master.