@duraxis/orm 0.1.0 → 0.3.0

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/CHANGELOG.md CHANGED
@@ -1,4 +1,44 @@
1
1
  # @duraxis/orm changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - eb56e40: Add transactional collection alteration/removal, final-schema validation, schema-aware index rebuilding, and protected subsystem metadata. Add standalone ORM schema export and opt-in strict managed validation. Introduce the migration runtime and CLI with snapshots, schema comparison, atomic history, conservative rollback, baseline adoption, and recovery-aware publication. Document deployment sequencing and transaction memory limits.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [eb56e40]
12
+ - @duraxis/core@0.3.0
13
+
14
+ ## 0.2.2
15
+
16
+ ### Patch Changes
17
+
18
+ - 8c357b5: fix: padronize the published versions
19
+ - 8c357b5: fix: padronize the published versions
20
+ - Updated dependencies [8c357b5]
21
+ - Updated dependencies [8c357b5]
22
+ - @duraxis/core@0.2.2
23
+
24
+ ## 0.2.1
25
+
26
+ ### Patch Changes
27
+
28
+ - e6facc7: fix: padronize the published versions
29
+ - Updated dependencies [e6facc7]
30
+ - @duraxis/core@0.2.1
31
+
32
+ ## 0.2.0
33
+
34
+ ### Minor Changes
35
+
36
+ - 6123078: Add transactional foreign-key integrity, referential actions, ORM relationship decorators, batched relation loading, and ManyToMany association operations.
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [6123078]
41
+ - @duraxis/core@0.2.0
42
+
3
43
  This file is maintained by Changesets. Future releases will add versioned
4
44
  entries automatically.
package/README.md CHANGED
@@ -55,4 +55,18 @@ await orm.close();
55
55
  O ORM exige inicialização antes de obter repositórios. O modo `create` cria estruturas
56
56
  ausentes, mas não é uma ferramenta geral de migrações destrutivas; `validate` verifica o schema
57
57
  existente. Decorators registram metadados quando a classe é avaliada, por isso este pacote não é
58
- marcado como livre de efeitos colaterais. Requer Node.js 22.12+.
58
+ marcado como livre de efeitos colaterais. Requer Node.js 24.15.0+.
59
+
60
+ ## Schema export and migrations
61
+
62
+ `exportSchema(entities)` returns deterministic normalized Core collection
63
+ definitions without opening a database. It reuses finalized decorator metadata,
64
+ including inherited fields, junction collections, foreign keys, and supporting
65
+ indexes. Use this API with `@duraxis/migrations` schema comparison, or use
66
+ [`@duraxis/cli`](../cli/README.md) for snapshot-based generation.
67
+
68
+ The opt-in `schema: { mode: "validate-managed" }` also rejects unexpected indexes
69
+ on registered entity/junction collections. Unrelated collections remain allowed.
70
+ Existing `create` and `validate` modes preserve their behavior and declaration
71
+ order. Production can run `duraxis migrate:up` before ORM initialization with
72
+ schema validation; startup does not automatically execute migrations.
@@ -0,0 +1,19 @@
1
+ import type { ReferentialAction } from "@duraxis/core";
2
+ import type { EntityClass } from "../metadata/entity-metadata.js";
3
+ export interface OwningRelationOptions {
4
+ readonly foreignKey: string;
5
+ readonly onDelete?: ReferentialAction;
6
+ }
7
+ export interface JoinTableOptions {
8
+ readonly name: string;
9
+ readonly joinColumn?: string;
10
+ readonly inverseJoinColumn?: string;
11
+ }
12
+ type TargetFactory<TTarget extends object> = () => EntityClass<TTarget>;
13
+ type Selector<TTarget extends object> = (entity: TTarget) => unknown;
14
+ export declare function ManyToOne<TTarget extends object>(target: TargetFactory<TTarget>, options: OwningRelationOptions): PropertyDecorator;
15
+ export declare function OneToMany<TTarget extends object>(target: TargetFactory<TTarget>, inverse: Selector<TTarget>): PropertyDecorator;
16
+ export declare function OneToOne<TTarget extends object>(target: TargetFactory<TTarget>, inverseOrOptions: Selector<TTarget> | OwningRelationOptions): PropertyDecorator;
17
+ export declare function ManyToMany<TTarget extends object>(target: TargetFactory<TTarget>, inverse: Selector<TTarget>): PropertyDecorator;
18
+ export declare function JoinTable(options: JoinTableOptions): PropertyDecorator;
19
+ export {};