forge-sql-orm 1.0.30 → 1.1.31
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 +242 -661
- package/dist/ForgeSQLORM.js +541 -568
- package/dist/ForgeSQLORM.js.map +1 -1
- package/dist/ForgeSQLORM.mjs +539 -555
- package/dist/ForgeSQLORM.mjs.map +1 -1
- package/dist/core/ForgeSQLCrudOperations.d.ts +101 -130
- package/dist/core/ForgeSQLCrudOperations.d.ts.map +1 -1
- package/dist/core/ForgeSQLORM.d.ts +11 -10
- package/dist/core/ForgeSQLORM.d.ts.map +1 -1
- package/dist/core/ForgeSQLQueryBuilder.d.ts +271 -113
- package/dist/core/ForgeSQLQueryBuilder.d.ts.map +1 -1
- package/dist/core/ForgeSQLSelectOperations.d.ts +65 -22
- package/dist/core/ForgeSQLSelectOperations.d.ts.map +1 -1
- package/dist/core/SystemTables.d.ts +59 -0
- package/dist/core/SystemTables.d.ts.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/utils/sqlUtils.d.ts +53 -6
- package/dist/utils/sqlUtils.d.ts.map +1 -1
- package/dist-cli/cli.js +561 -360
- package/dist-cli/cli.js.map +1 -1
- package/dist-cli/cli.mjs +561 -360
- package/dist-cli/cli.mjs.map +1 -1
- package/package.json +26 -26
- package/src/core/ForgeSQLCrudOperations.ts +360 -473
- package/src/core/ForgeSQLORM.ts +40 -78
- package/src/core/ForgeSQLQueryBuilder.ts +250 -133
- package/src/core/ForgeSQLSelectOperations.ts +182 -72
- package/src/core/SystemTables.ts +7 -0
- package/src/index.ts +1 -2
- package/src/utils/sqlUtils.ts +155 -23
- package/dist/core/ComplexQuerySchemaBuilder.d.ts +0 -38
- package/dist/core/ComplexQuerySchemaBuilder.d.ts.map +0 -1
- package/dist/knex/index.d.ts +0 -4
- package/dist/knex/index.d.ts.map +0 -1
- package/src/core/ComplexQuerySchemaBuilder.ts +0 -63
- package/src/knex/index.ts +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import ForgeSQLORM from "./core/ForgeSQLORM";
|
|
|
2
2
|
export * from "./core/ForgeSQLQueryBuilder";
|
|
3
3
|
export * from "./core/ForgeSQLCrudOperations";
|
|
4
4
|
export * from "./core/ForgeSQLSelectOperations";
|
|
5
|
-
export * from "
|
|
6
|
-
export * from "@mikro-orm/entity-generator";
|
|
5
|
+
export * from "./utils/sqlUtils";
|
|
7
6
|
export default ForgeSQLORM;
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAE7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAE7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kBAAkB,CAAC;AAEjC,eAAe,WAAW,CAAC"}
|
package/dist/utils/sqlUtils.d.ts
CHANGED
|
@@ -1,8 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { AnyColumn } from "drizzle-orm";
|
|
2
|
+
import { AnyMySqlTable } from "drizzle-orm/mysql-core/index";
|
|
3
|
+
import { PrimaryKeyBuilder } from "drizzle-orm/mysql-core/primary-keys";
|
|
4
|
+
import { AnyIndexBuilder } from "drizzle-orm/mysql-core/indexes";
|
|
5
|
+
import { CheckBuilder } from "drizzle-orm/mysql-core/checks";
|
|
6
|
+
import { ForeignKeyBuilder } from "drizzle-orm/mysql-core/foreign-keys";
|
|
7
|
+
import { UniqueConstraintBuilder } from "drizzle-orm/mysql-core/unique-constraint";
|
|
8
|
+
/**
|
|
9
|
+
* Interface representing table metadata information
|
|
10
|
+
*/
|
|
11
|
+
export interface MetadataInfo {
|
|
12
|
+
/** The name of the table */
|
|
13
|
+
tableName: string;
|
|
14
|
+
/** Record of column names and their corresponding column definitions */
|
|
15
|
+
columns: Record<string, AnyColumn>;
|
|
16
|
+
/** Array of index builders */
|
|
17
|
+
indexes: AnyIndexBuilder[];
|
|
18
|
+
/** Array of check constraint builders */
|
|
19
|
+
checks: CheckBuilder[];
|
|
20
|
+
/** Array of foreign key builders */
|
|
21
|
+
foreignKeys: ForeignKeyBuilder[];
|
|
22
|
+
/** Array of primary key builders */
|
|
23
|
+
primaryKeys: PrimaryKeyBuilder[];
|
|
24
|
+
/** Array of unique constraint builders */
|
|
25
|
+
uniqueConstraints: UniqueConstraintBuilder[];
|
|
26
|
+
/** Array of all extra builders */
|
|
27
|
+
extras: any[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parses a date string into a Date object using the specified format
|
|
31
|
+
* @param value - The date string to parse
|
|
32
|
+
* @param format - The format to use for parsing
|
|
33
|
+
* @returns Date object
|
|
34
|
+
*/
|
|
7
35
|
export declare const parseDateTime: (value: string, format: string) => Date;
|
|
36
|
+
/**
|
|
37
|
+
* Extracts the alias from a SQL query
|
|
38
|
+
* @param query - The SQL query to extract the alias from
|
|
39
|
+
* @returns The extracted alias or the original query if no alias found
|
|
40
|
+
*/
|
|
41
|
+
export declare function extractAlias(query: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Gets primary keys from the schema.
|
|
44
|
+
* @template T - The type of the table schema
|
|
45
|
+
* @param {T} table - The table schema
|
|
46
|
+
* @returns {[string, AnyColumn][] | undefined} Array of primary key name and column pairs or undefined if no primary keys found
|
|
47
|
+
*/
|
|
48
|
+
export declare function getPrimaryKeys<T extends AnyMySqlTable>(table: T): [string, AnyColumn][] | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Extracts table metadata from the schema.
|
|
51
|
+
* @param {AnyMySqlTable} table - The table schema
|
|
52
|
+
* @returns {MetadataInfo} Object containing table metadata
|
|
53
|
+
*/
|
|
54
|
+
export declare function getTableMetadata(table: AnyMySqlTable): MetadataInfo;
|
|
8
55
|
//# sourceMappingURL=sqlUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlUtils.d.ts","sourceRoot":"","sources":["../../src/utils/sqlUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sqlUtils.d.ts","sourceRoot":"","sources":["../../src/utils/sqlUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAgB,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAEnF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACnC,8BAA8B;IAC9B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,yCAAyC;IACzC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,oCAAoC;IACpC,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,oCAAoC;I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