docs: declare table fields with @Field and @Relation decorators in examples - #19
Merged
Conversation
Member
Author
|
@greptile review |
Upd4ting
approved these changes
Jul 13, 2026
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
Follow-up to #16, which migrated the test fixtures: the table-declaring examples in the docs still used the legacy style (bare
declarefields). Since properties without@Fieldare omitted from theTableDefinition.fieldsmap handed to the adapter, the examples produced tables with no field definitions.@Field(type)added on every table column in every example.@Relation({ to: () => Target })added on foreign-key fields — notably in the foreign-keys and joined docs, which document cross-table references without declaring the relation at the table level (Order.userId,Cart.itemswithmany: true,Device.group_id).@Fieldis a table-level (database-decorators) concern.Files
docs/1.introduction.mddocs/2.data-controllers.mddocs/7.foreign-keys.mddocs/9.modifiers.mddocs/10.joined.mddocs/11.computed.mdGreptile Summary
This PR updates the docs examples to use table field metadata consistently.
@Fielddecorators to table column declarations.@Relationmetadata to foreign-key fields.many: truetable metadata versus controller-side multi-value resolution.Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Fieldto the imports and annotates the user table fields.Fieldto the imports and annotates the table model fields.Fieldmetadata to the localized content table example.Comments Outside Diff (1)
docs/11.computed.md, line 14 (link)The example now uses
@Fieldand later@Relation, but the code block still only importsComputed. Copying this example as written will fail to type-check with missing names for the table decorators, so the new field and relation declarations are not usable without adding the@antelopejs/interface-database-decoratorsimport.Prompt To Fix With AI
Reviews (2): Last reviewed commit: "docs: address greptile review feedback (..." | Re-trigger Greptile