metal-orm 1.0.10 → 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.
Files changed (40) hide show
  1. package/README.md +17 -15
  2. package/dist/decorators/index.cjs +15 -2
  3. package/dist/decorators/index.cjs.map +1 -1
  4. package/dist/decorators/index.d.cts +1 -1
  5. package/dist/decorators/index.d.ts +1 -1
  6. package/dist/decorators/index.js +15 -2
  7. package/dist/decorators/index.js.map +1 -1
  8. package/dist/index.cjs +1394 -149
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +257 -23
  11. package/dist/index.d.ts +257 -23
  12. package/dist/index.js +1376 -149
  13. package/dist/index.js.map +1 -1
  14. package/dist/{select-654m4qy8.d.cts → select-BKlr2ivY.d.cts} +141 -4
  15. package/dist/{select-654m4qy8.d.ts → select-BKlr2ivY.d.ts} +141 -4
  16. package/package.json +1 -1
  17. package/src/core/ddl/dialects/base-schema-dialect.ts +48 -0
  18. package/src/core/ddl/dialects/index.ts +5 -0
  19. package/src/core/ddl/dialects/mssql-schema-dialect.ts +97 -0
  20. package/src/core/ddl/dialects/mysql-schema-dialect.ts +109 -0
  21. package/src/core/ddl/dialects/postgres-schema-dialect.ts +99 -0
  22. package/src/core/ddl/dialects/sqlite-schema-dialect.ts +103 -0
  23. package/src/core/ddl/introspect/mssql.ts +149 -0
  24. package/src/core/ddl/introspect/mysql.ts +99 -0
  25. package/src/core/ddl/introspect/postgres.ts +154 -0
  26. package/src/core/ddl/introspect/sqlite.ts +66 -0
  27. package/src/core/ddl/introspect/types.ts +19 -0
  28. package/src/core/ddl/introspect/utils.ts +27 -0
  29. package/src/core/ddl/schema-diff.ts +179 -0
  30. package/src/core/ddl/schema-generator.ts +229 -0
  31. package/src/core/ddl/schema-introspect.ts +32 -0
  32. package/src/core/ddl/schema-types.ts +39 -0
  33. package/src/core/dialect/base/sql-dialect.ts +161 -0
  34. package/src/core/dialect/mysql/index.ts +18 -112
  35. package/src/core/dialect/postgres/index.ts +30 -126
  36. package/src/core/dialect/sqlite/index.ts +29 -129
  37. package/src/index.ts +15 -10
  38. package/src/schema/column.ts +206 -27
  39. package/src/schema/table.ts +89 -32
  40. package/src/schema/types.ts +8 -5
@@ -1,4 +1,4 @@
1
- import { w as TableHooks, y as ColumnType, C as ColumnDef, T as TableDef, K as CascadeMode, v as SelectQueryBuilder } from '../select-654m4qy8.cjs';
1
+ import { K as TableHooks, Q as ColumnType, C as ColumnDef, T as TableDef, a0 as CascadeMode, z as SelectQueryBuilder } from '../select-BKlr2ivY.cjs';
2
2
 
3
3
  interface EntityOptions {
4
4
  tableName?: string;
@@ -1,4 +1,4 @@
1
- import { w as TableHooks, y as ColumnType, C as ColumnDef, T as TableDef, K as CascadeMode, v as SelectQueryBuilder } from '../select-654m4qy8.js';
1
+ import { K as TableHooks, Q as ColumnType, C as ColumnDef, T as TableDef, a0 as CascadeMode, z as SelectQueryBuilder } from '../select-BKlr2ivY.js';
2
2
 
3
3
  interface EntityOptions {
4
4
  tableName?: string;
@@ -1,10 +1,23 @@
1
1
  // src/schema/table.ts
2
- var defineTable = (name, columns, relations = {}, hooks) => {
2
+ var defineTable = (name, columns, relations = {}, hooks, options = {}) => {
3
3
  const colsWithNames = Object.entries(columns).reduce((acc, [key, def]) => {
4
4
  acc[key] = { ...def, name: key, table: name };
5
5
  return acc;
6
6
  }, {});
7
- return { name, columns: colsWithNames, relations, hooks };
7
+ return {
8
+ name,
9
+ schema: options.schema,
10
+ columns: colsWithNames,
11
+ relations,
12
+ hooks,
13
+ primaryKey: options.primaryKey,
14
+ indexes: options.indexes,
15
+ checks: options.checks,
16
+ comment: options.comment,
17
+ engine: options.engine,
18
+ charset: options.charset,
19
+ collation: options.collation
20
+ };
8
21
  };
9
22
 
10
23
  // src/orm/entity-metadata.ts