Lucid Documentation Updates: Column Alias Prefix and Schema Rules Import Paths
· Developer impact : medium
The Lucid ORM documentation was updated to introduce the `columnAliasPrefix` static property for models to customize table-qualified column aliases when joining tables, preventing alias conflicts. Additionally, guidance was clarified on how to specify `rulesPaths` in schema generation configuration, emphasizing that entries are import identifiers resolved like ES module imports, requiring relative paths (e.g., starting with `./`) or package names. A note was added about PostgreSQL's node-postgres driver returning `bigint` values as strings, recommending typing them as `string` via global schema rules.
Developers using Lucid's query builder with joins can now avoid column alias conflicts by setting `columnAliasPrefix` on their models. When configuring schema generation, developers must ensure `rulesPaths` entries are valid import identifiers, using relative paths or package names, to avoid import errors. PostgreSQL users should adjust their schema rules to type `bigint` columns as `string` to match driver behavior, preventing type mismatches.
- Use the `columnAliasPrefix` static property in models to customize column alias prefixes when joining tables to avoid alias conflicts.
- When configuring `rulesPaths` for schema generation, specify import identifiers correctly: use relative paths starting with `./` or package names, not bare file paths.
- For PostgreSQL users, define a global schema rule to type `bigint` columns as `string` to align with node-postgres driver behavior.
Updated documentation
Original sources
- lucid.adonisjs.com: 2 documentation file(s) ↗
- lucid.adonisjs.com: 1 documentation file(s) ↗
- lucid.adonisjs.com: 2 documentation file(s) ↗
AI-generated analysis based on the linked sources. Check the original documentation before changing your application.