Repository navigation
Conversation
- condition: a private `_Ordering` enum (gt, gte, lt, lte; `mirrored`,
`test`) behind the ordering methods of `ConditionParameter` and
`Condition` (public methods kept as one-line delegates; the unused
`keyType` documented), and a private `_KeyConditionOrdering` base of the
four `KeyCondition{GreaterThan,...}` classes (constructors, `cast` and
symbols kept). `encodeValue` moved into `KeyCondition`.
- `ConditionParameter.matchesIn`: the parameters among the values are
resolved once, not once per element.
- `KeyConditionRegExp._literalRegExp` -> `_literalRegExpCache`, documented.
- encoder: `isReservedWord` by a const set; `TypeInfo.from(valueType)`
computed once; `EncodingContext.parameterValue`.
- condition SQL: `_encodeIDComparison`, `_requireTableScheme`,
`_writeEmptySetMatch`, `qualifiedColumnSQL`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `SQLGenerator.uniqueConstraintName`, `indexName`, `foreignKeyName` and `relationshipTableName` (byte-identical names), also used by the scheme check and the in-memory adapter's relationship table. - Locals `constrain*Name` -> `constraint*Name`. - `SQLDialect.qualifiedColumnSQL` (used by `orderBySQL`). - `CreateTableSQL`/`AlterTableSQL` table caches named `*Cache`, documented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `_checkDBTableScheme` split into helpers named after its sections (`_findMissingReferenceConstraints`, `_findMissingRelationshipIndexes`, `_findMissingEnumConstraints`, `_dedupeMissingEntityIndexes`, `_findEntityIndexesNameConflicts`, `_tableCheckErrorLine`), with `_sameManagerEntityTypes` for the identical to-one/to-many blocks, a local `columnsOf`, and the "No scheme" message written once. - Relationship generators: `_requireTableScheme`, `_requireRelationship`; `_generateConstrainRelationshipSQL` takes the resolved relationship; `_selectRelationshipSQLText` and `_executeSelectRelationshipSQL` shared by the single/multiple relationship selects. - JOINs: `SQLDialect.qualifiedColumnSQL` and `_joinKeyword` (same SQL). - `SQL`: `_positionalCache` declared before the method that fills it; the lazy positional fields documented. - Typo locals (`colum`, `constrainSQL`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `_selectEntries`: the two near-identical matching branches as one closure (references resolved only when needed, as before). - `_hasNoReferences` (select and delete) and `_deleteMatchedEntries` (the three delete branches). The parameters each passes are kept, and the difference documented (select: `namedParameters ?? parametersByPlaceholder`; delete: `parametersByPlaceholder`). - `_tablesVersions`/`_tablesIndexesVersions` -> `*Cache`, documented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`_parseSelectDirectives` (with `_extractIntDirective` for the identical LIMIT/OFFSET/PAGE blocks), `_buildSelectTableHTML` and `_buildPaginationHTML`. Same HTML. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`characterEscapeValue2` used `characterEscape`, whose pattern excludes
`'`, so `Condition.parse("name == 'a\\'b'")` failed (`"\'" expected`);
the unused `jsonEscapeCharsString2` was meant for it. Now
`characterEscape2`. Test in bones_api_condition_test.dart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It lacked a space after `name: $name,` and omitted `acceptsVarcharWithoutMaximumSize`, `intParameterTypeSuffix`, `maxIDsAsParameters`, `regExpSyntax` and `subqueryAsDerivedTable`. Tests in bones_api_cov_sql_builder_test.dart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The values (and IDs in links) were written into the HTML as is: a value with `<` or `&` broke the page and could inject markup or scripts. Now escaped with `HtmlEscape` (element text; attribute for the links). Test in bones_api_cov_db_module_test.dart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gmpassos
added a commit
that referenced
this pull request
Nov 8, 2026
…0 branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # CHANGELOG.md
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #207 +/- ##
==========================================
- Coverage 95.85% 95.81% -0.04%
==========================================
Files 75 75
Lines 26519 26400 -119
==========================================
- Hits 25419 25296 -123
- Misses 1100 1104 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Merged into the single v1.35.0 PR: #209. |
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.
Clean-up of the conditions and SQL generation code (behavior-preserving; the generated SQL is byte-identical), plus three bug fixes, each in its own commit with a test. Bumps to v1.35.0 (v1.34.0 is tagged).
Refactors (no behavior change)
bones_api_condition.dart)>,>=,<,<=) were written three times. They now go through a private_Orderingenum (gt,gte,lt,lte, withmirroredandtest) and a private_KeyConditionOrderingbase class. The public methods are one-line delegates, and eachKeyCondition{GreaterThan,...}keeps its constructor,castand symbol.encodeValuemoved intoKeyCondition(KeyConditionRegExpkeeps its override). The unusedkeyTypeparameter is documented, not removed.ConditionParameter.matchesInresolves its parameters once, not n×m times._literalRegExprenamed_literalRegExpCacheand documented.isReservedWordchecks a const set;TypeInfo.from(valueType)is computed once (late); newEncodingContext.parameterValue._encodeIDComparison,_requireTableScheme,_writeEmptySetMatchandqualifiedColumnSQL.SQLGenerator.uniqueConstraintName,indexName,foreignKeyNameandrelationshipTableName, also used by the scheme check and the memory adapter. The names they produce are unchanged.SQLDialect.qualifiedColumnSQL; localsconstrain*renamedconstraint*; table caches renamed*Cache._checkDBTableSchemesplit into helpers named after its sections, with_sameManagerEntityTypes,columnsOf, and the "No scheme" message written once._requireTableSchemeand_requireRelationship._generateConstrainRelationshipSQLnow takes the already-resolved relationship. New shared_selectRelationshipSQLTextand_executeSelectRelationshipSQL(log labels kept).qualifiedColumnSQLand_joinKeyword._positionalCachemoved above the method that fills it; the lazy positional fields documented (not renamed: they are named constructor parameters)._hasNoReferencesand_deleteMatchedEntries. Select and delete still pass different parameters (documented). Version caches renamed*Cache.APIDBModule.select: split into_parseSelectDirectives,_extractIntDirective,_buildSelectTableHTMLand_buildPaginationHTML.Fixes
Condition.parse("name == 'a\\'b'")failed ("\'" expected):characterEscapeValue2usedcharacterEscape, which doesn't accept'. It now uses a newcharacterEscape2built on the previously unusedjsonEscapeCharsString2. Test inbones_api_condition_test.dart.SQLDialect.toStringwas missing a space afternameand five fields. Tests inbones_api_cov_sql_builder_test.dart.APIDBModule.selectwrote entity values into its HTML without escaping. They are now escaped withHtmlEscape(element mode for text, attribute mode for link IDs). The test inbones_api_cov_db_module_test.dartfails without the fix.Not changed:
KeyCondition{GreaterThan,...}.matchesEntitynot forwardingkeyEntityHandler. The only handlermatchesEntityhas is the root entity's, which is the wrong one for a path key (owner.balance), andEntityHandler.*ThanValueignores the handler anyway, so no test could observe a change.KeyConditionEQ.matchesEntitybehaves the same way.Tests (local)
dart formatis clean.dart analyze --fatal-infos lib test example: no issues. Issues remain only inbenchmark/, a separate package that is not set up locally.bones_api_version_test.dart. Docker tests were not run (PostgreSQL and MySQL run in CI).🤖 Generated with Claude Code