metal-orm 1.0.11 → 1.0.12
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/README.md +4 -3
- package/dist/decorators/index.cjs +15 -2
- package/dist/decorators/index.cjs.map +1 -1
- package/dist/decorators/index.d.cts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +15 -2
- package/dist/decorators/index.js.map +1 -1
- package/dist/index.cjs +1394 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +257 -23
- package/dist/index.d.ts +257 -23
- package/dist/index.js +1376 -149
- package/dist/index.js.map +1 -1
- package/dist/{select-654m4qy8.d.cts → select-BKlr2ivY.d.cts} +141 -4
- package/dist/{select-654m4qy8.d.ts → select-BKlr2ivY.d.ts} +141 -4
- package/package.json +1 -1
- package/src/core/ddl/dialects/base-schema-dialect.ts +48 -0
- package/src/core/ddl/dialects/index.ts +5 -0
- package/src/core/ddl/dialects/mssql-schema-dialect.ts +97 -0
- package/src/core/ddl/dialects/mysql-schema-dialect.ts +109 -0
- package/src/core/ddl/dialects/postgres-schema-dialect.ts +99 -0
- package/src/core/ddl/dialects/sqlite-schema-dialect.ts +103 -0
- package/src/core/ddl/introspect/mssql.ts +149 -0
- package/src/core/ddl/introspect/mysql.ts +99 -0
- package/src/core/ddl/introspect/postgres.ts +154 -0
- package/src/core/ddl/introspect/sqlite.ts +66 -0
- package/src/core/ddl/introspect/types.ts +19 -0
- package/src/core/ddl/introspect/utils.ts +27 -0
- package/src/core/ddl/schema-diff.ts +179 -0
- package/src/core/ddl/schema-generator.ts +229 -0
- package/src/core/ddl/schema-introspect.ts +32 -0
- package/src/core/ddl/schema-types.ts +39 -0
- package/src/core/dialect/base/sql-dialect.ts +161 -0
- package/src/core/dialect/mysql/index.ts +18 -112
- package/src/core/dialect/postgres/index.ts +30 -126
- package/src/core/dialect/sqlite/index.ts +29 -129
- package/src/index.ts +4 -0
- package/src/schema/column.ts +206 -27
- package/src/schema/table.ts +89 -32
- package/src/schema/types.ts +8 -5
package/README.md
CHANGED
|
@@ -49,9 +49,10 @@ Full docs live in the `docs/` folder:
|
|
|
49
49
|
- [DML Operations](https://github.com/celsowm/metal-orm/blob/main/docs/dml-operations.md)
|
|
50
50
|
- [Hydration & Entities](https://github.com/celsowm/metal-orm/blob/main/docs/hydration.md)
|
|
51
51
|
- [Runtime & Unit of Work](https://github.com/celsowm/metal-orm/blob/main/docs/runtime.md)
|
|
52
|
-
- [Advanced Features](https://github.com/celsowm/metal-orm/blob/main/docs/advanced-features.md)
|
|
53
|
-
- [Multi-Dialect Support](https://github.com/celsowm/metal-orm/blob/main/docs/multi-dialect-support.md)
|
|
54
|
-
- [
|
|
52
|
+
- [Advanced Features](https://github.com/celsowm/metal-orm/blob/main/docs/advanced-features.md)
|
|
53
|
+
- [Multi-Dialect Support](https://github.com/celsowm/metal-orm/blob/main/docs/multi-dialect-support.md)
|
|
54
|
+
- [Schema Generation (DDL)](https://github.com/celsowm/metal-orm/blob/main/docs/schema-generation.md)
|
|
55
|
+
- [API Reference](https://github.com/celsowm/metal-orm/blob/main/docs/api-reference.md)
|
|
55
56
|
|
|
56
57
|
---
|
|
57
58
|
|
|
@@ -32,12 +32,25 @@ __export(decorators_exports, {
|
|
|
32
32
|
module.exports = __toCommonJS(decorators_exports);
|
|
33
33
|
|
|
34
34
|
// src/schema/table.ts
|
|
35
|
-
var defineTable = (name, columns, relations = {}, hooks) => {
|
|
35
|
+
var defineTable = (name, columns, relations = {}, hooks, options = {}) => {
|
|
36
36
|
const colsWithNames = Object.entries(columns).reduce((acc, [key, def]) => {
|
|
37
37
|
acc[key] = { ...def, name: key, table: name };
|
|
38
38
|
return acc;
|
|
39
39
|
}, {});
|
|
40
|
-
return {
|
|
40
|
+
return {
|
|
41
|
+
name,
|
|
42
|
+
schema: options.schema,
|
|
43
|
+
columns: colsWithNames,
|
|
44
|
+
relations,
|
|
45
|
+
hooks,
|
|
46
|
+
primaryKey: options.primaryKey,
|
|
47
|
+
indexes: options.indexes,
|
|
48
|
+
checks: options.checks,
|
|
49
|
+
comment: options.comment,
|
|
50
|
+
engine: options.engine,
|
|
51
|
+
charset: options.charset,
|
|
52
|
+
collation: options.collation
|
|
53
|
+
};
|
|
41
54
|
};
|
|
42
55
|
|
|
43
56
|
// src/orm/entity-metadata.ts
|