uql-orm 0.105.0 → 0.105.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/querier/httpQuerier.d.ts +3 -3
- package/dist/browser/type/clientQuerier.d.ts +1 -1
- package/dist/browser/uql-browser.min.js +2 -2
- package/dist/browser/uql-browser.min.js.map +5 -5
- package/dist/cockroachdb/cockroachDialect.d.ts +2 -2
- package/dist/dialect/abstractDialect.d.ts +3 -3
- package/dist/dialect/abstractSqlDialect.d.ts +35 -35
- package/dist/dialect/mergeSqlDialect.d.ts +2 -2
- package/dist/dialect/mysqlLikeSqlDialect.d.ts +6 -6
- package/dist/dialect/queryJoins.d.ts +2 -2
- package/dist/entity/decorator/bag.d.ts +2 -2
- package/dist/entity/decorator/entity.d.ts +2 -2
- package/dist/entity/metadata/definition.d.ts +9 -6
- package/dist/entity/metadata/definition.js +18 -4
- package/dist/entity/metadata/schemaFixture/author.d.ts +2 -2
- package/dist/entity/metadata/schemaFixture/book.d.ts +1 -1
- package/dist/entity/metadata/schemaFixture/book.js +2 -1
- package/dist/http/contract.d.ts +2 -2
- package/dist/http/handler.d.ts +2 -2
- package/dist/mariadb/mariaDialect.d.ts +2 -2
- package/dist/migrate/codegen/entityTypes.d.ts +2 -2
- package/dist/migrate/migrator.d.ts +2 -2
- package/dist/migrate/schemaGenerator.d.ts +5 -5
- package/dist/mongodb/mongoDialect.d.ts +12 -12
- package/dist/mongodb/mongoSchemaGenerator.d.ts +4 -4
- package/dist/mssql/mssqlDialect.d.ts +4 -4
- package/dist/postgres/postgresDialect.d.ts +2 -2
- package/dist/querier/abstractSqlQuerier.d.ts +1 -1
- package/dist/schema/schemaASTBuilder.d.ts +4 -4
- package/dist/type/column.d.ts +2 -2
- package/dist/type/config.d.ts +2 -2
- package/dist/type/dialect.d.ts +13 -13
- package/dist/type/entity.d.ts +2 -2
- package/dist/type/migration.d.ts +7 -7
- package/dist/type/querier.d.ts +2 -2
- package/dist/type/querySql.d.ts +2 -2
- package/dist/type/schemaEntity.d.ts +20 -16
- package/dist/type/utility.d.ts +4 -1
- package/dist/util/hook.util.d.ts +2 -2
- package/dist/util/sql.d.ts +4 -4
- package/dist/util/triggerWrite.d.ts +5 -5
- package/package.json +1 -1
- package/skills/uql-orm/SKILL.md +2 -2
package/skills/uql-orm/SKILL.md
CHANGED
|
@@ -82,7 +82,7 @@ export class Post {
|
|
|
82
82
|
- Declare a NOT NULL column with `!` (`email!: string`). Declare `?` for anything else an insert may omit: nullable, `.eager(false)`, computed fields and relations. uql fills a single-column key and a version.
|
|
83
83
|
- A NOT NULL field a default fills (`.default()`, `.onInsert()`) is `!` and listed in the class's `[filledKey]?: 'stock' | 'createdAt'`: inserts may omit it, reads always have it.
|
|
84
84
|
- `.default()` takes a value of the field's type, or SQL the database evaluates per row: `currentTimestamp`, `currentDate`, `currentTime`, `uuid` (not SQLite), `uuidv7` (Postgres 18+, MariaDB 11.7+), or ``sql`...` ``. A plain string is always text, `'CURRENT_TIMESTAMP'` included.
|
|
85
|
-
- A class inherits its base's fields, relations, hooks, filters, indexes, checks and triggers. A base of fields alone needs no `@Entity()`; one declaring indexes, filters, checks or triggers but no table is `@Entity({ abstract: true, ... })`.
|
|
85
|
+
- A class inherits its base's fields, relations, hooks, filters, indexes, checks and triggers. A base of fields alone needs no `@Entity()`; one declaring indexes, filters, checks or triggers but no table is `@Entity({ abstract: true, ... }) abstract class`, or a schema's `abstract: true`. A query or write on one does not compile: query the entities extending it.
|
|
86
86
|
- `Date` is an instant, stored in UTC to the millisecond on every engine. `f.decimal()` is exact text (`price?: string | null`). `f.number().precision(10).scale(2)` opts into a rounding JS number.
|
|
87
87
|
- Members are named by callbacks, never strings: `mappedBy: (post) => post.author`, `references: (post) => post.authorId`. Either may be left out where only one member fits: a decorated many-to-one's one foreign key to its target, a one-to-many's one many-to-one pointing back.
|
|
88
88
|
- `@ManyToMany({ entity: () => Tag, through: () => PostTag })` names the junction entity. `cascade: true` writes related rows in the same transaction; an update replaces a to-many's rows.
|
|
@@ -131,7 +131,7 @@ export const Book = defineEntity({
|
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
- Each field is a column builder, as in the decorated form. The row follows from them: a key, a version and a NOT NULL column are always present, a `.nullable()` one reads `| null`; a default (`.default()`, `.onInsert()`, `.autoIncrement()`) makes it optional on insert; `f.enum()` gives the literal union. No `!`, `?` or brands to write.
|
|
134
|
-
- The other options are sections chained after `defineEntity`, each called at most once: `computed`, `indexes`, `checks`, `triggers`, `filters` and `hooks` read the columns; `references` points a foreign key with no relation at its target; `relations` comes last. `defineEntity` itself takes `name` (the class name, which a naming strategy derives the table from), `table`, `schema`, `extends` and `fields`.
|
|
134
|
+
- The other options are sections chained after `defineEntity`, each called at most once: `computed`, `indexes`, `checks`, `triggers`, `filters` and `hooks` read the columns; `references` points a foreign key with no relation at its target; `relations` comes last, but for a `filters` that reads through them: `.relations(...).filters({ byActiveAuthor: { where: { author: { active: true } } } })`. `defineEntity` itself takes `name` (the class name, which a naming strategy derives the table from), `table`, `schema`, `extends` and `fields`.
|
|
135
135
|
- Each relation is a thunk, `author: () => rel.manyToOne(...)`, so entities pointing at each other can sit in either order and in different files. `manyToOne` names its `references`; `oneToMany(Book)` with no options is mapped by the one relation of `Book` pointing back.
|
|
136
136
|
- `relations`' second callback reads values over a to-many as columns: `(agg) => ({ bookCount: () => agg.books.count() })`.
|
|
137
137
|
- A hook is a function of the row and `{ querier, onCommit }`.
|