@fragno-dev/db 0.0.1 → 0.1.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/.turbo/turbo-build.log +137 -13
- package/.turbo/turbo-test.log +36 -0
- package/CHANGELOG.md +7 -0
- package/dist/adapters/adapters.d.ts +18 -0
- package/dist/adapters/adapters.d.ts.map +1 -0
- package/dist/adapters/drizzle/drizzle-adapter.d.ts +21 -0
- package/dist/adapters/drizzle/drizzle-adapter.d.ts.map +1 -0
- package/dist/adapters/drizzle/drizzle-adapter.js +62 -0
- package/dist/adapters/drizzle/drizzle-adapter.js.map +1 -0
- package/dist/adapters/drizzle/drizzle-query.d.ts +17 -0
- package/dist/adapters/drizzle/drizzle-query.d.ts.map +1 -0
- package/dist/adapters/drizzle/drizzle-query.js +139 -0
- package/dist/adapters/drizzle/drizzle-query.js.map +1 -0
- package/dist/adapters/drizzle/drizzle-uow-compiler.d.ts +9 -0
- package/dist/adapters/drizzle/drizzle-uow-compiler.d.ts.map +1 -0
- package/dist/adapters/drizzle/drizzle-uow-compiler.js +300 -0
- package/dist/adapters/drizzle/drizzle-uow-compiler.js.map +1 -0
- package/dist/adapters/drizzle/drizzle-uow-decoder.js +82 -0
- package/dist/adapters/drizzle/drizzle-uow-decoder.js.map +1 -0
- package/dist/adapters/drizzle/drizzle-uow-executor.js +125 -0
- package/dist/adapters/drizzle/drizzle-uow-executor.js.map +1 -0
- package/dist/adapters/drizzle/generate.js +273 -0
- package/dist/adapters/drizzle/generate.js.map +1 -0
- package/dist/adapters/drizzle/join-column-utils.js +28 -0
- package/dist/adapters/drizzle/join-column-utils.js.map +1 -0
- package/dist/adapters/drizzle/shared.js +11 -0
- package/dist/adapters/drizzle/shared.js.map +1 -0
- package/dist/adapters/kysely/kysely-adapter.d.ts +23 -0
- package/dist/adapters/kysely/kysely-adapter.d.ts.map +1 -0
- package/dist/adapters/kysely/kysely-adapter.js +119 -0
- package/dist/adapters/kysely/kysely-adapter.js.map +1 -0
- package/dist/adapters/kysely/kysely-query-builder.js +306 -0
- package/dist/adapters/kysely/kysely-query-builder.js.map +1 -0
- package/dist/adapters/kysely/kysely-query-compiler.js +67 -0
- package/dist/adapters/kysely/kysely-query-compiler.js.map +1 -0
- package/dist/adapters/kysely/kysely-query.js +158 -0
- package/dist/adapters/kysely/kysely-query.js.map +1 -0
- package/dist/adapters/kysely/kysely-uow-compiler.js +139 -0
- package/dist/adapters/kysely/kysely-uow-compiler.js.map +1 -0
- package/dist/adapters/kysely/kysely-uow-executor.js +89 -0
- package/dist/adapters/kysely/kysely-uow-executor.js.map +1 -0
- package/dist/adapters/kysely/migration/execute.js +176 -0
- package/dist/adapters/kysely/migration/execute.js.map +1 -0
- package/dist/fragment.d.ts +54 -0
- package/dist/fragment.d.ts.map +1 -0
- package/dist/fragment.js +92 -0
- package/dist/fragment.js.map +1 -0
- package/dist/id.d.ts +2 -0
- package/dist/migration-engine/auto-from-schema.js +116 -0
- package/dist/migration-engine/auto-from-schema.js.map +1 -0
- package/dist/migration-engine/create.d.ts +41 -0
- package/dist/migration-engine/create.d.ts.map +1 -0
- package/dist/migration-engine/create.js +58 -0
- package/dist/migration-engine/create.js.map +1 -0
- package/dist/migration-engine/shared.d.ts +90 -0
- package/dist/migration-engine/shared.d.ts.map +1 -0
- package/dist/migration-engine/shared.js +8 -0
- package/dist/migration-engine/shared.js.map +1 -0
- package/dist/mod.d.ts +55 -2
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +111 -2
- package/dist/mod.js.map +1 -1
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/column-builder.js +108 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/column-builder.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/column.js +55 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/column.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/entity.js +18 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/entity.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/columns/common.js +183 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/columns/common.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/columns/enum.js +58 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/columns/enum.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/foreign-keys.js +68 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/foreign-keys.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/unique-constraint.js +56 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/unique-constraint.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/utils/array.js +65 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/pg-core/utils/array.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/sql/expressions/conditions.js +81 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/sql/expressions/conditions.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/sql/expressions/select.js +13 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/sql/expressions/select.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/sql/functions/aggregate.js +10 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/sql/functions/aggregate.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/sql/sql.js +372 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/sql/sql.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/subquery.js +23 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/subquery.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/table.js +62 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/table.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/table.utils.js +6 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/table.utils.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/tracing-utils.js +8 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/tracing-utils.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/tracing.js +8 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/tracing.js.map +1 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/view-common.js +6 -0
- package/dist/node_modules/.bun/drizzle-orm@0.44.6_4fae081eecb963e2/node_modules/drizzle-orm/view-common.js.map +1 -0
- package/dist/query/condition-builder.d.ts +41 -0
- package/dist/query/condition-builder.d.ts.map +1 -0
- package/dist/query/condition-builder.js +93 -0
- package/dist/query/condition-builder.js.map +1 -0
- package/dist/query/cursor.d.ts +88 -0
- package/dist/query/cursor.d.ts.map +1 -0
- package/dist/query/cursor.js +103 -0
- package/dist/query/cursor.js.map +1 -0
- package/dist/query/orm/orm.d.ts +18 -0
- package/dist/query/orm/orm.d.ts.map +1 -0
- package/dist/query/orm/orm.js +48 -0
- package/dist/query/orm/orm.js.map +1 -0
- package/dist/query/query.d.ts +79 -0
- package/dist/query/query.d.ts.map +1 -0
- package/dist/query/query.js +1 -0
- package/dist/query/result-transform.js +155 -0
- package/dist/query/result-transform.js.map +1 -0
- package/dist/query/unit-of-work.d.ts +435 -0
- package/dist/query/unit-of-work.d.ts.map +1 -0
- package/dist/query/unit-of-work.js +549 -0
- package/dist/query/unit-of-work.js.map +1 -0
- package/dist/schema/create.d.ts +273 -116
- package/dist/schema/create.d.ts.map +1 -1
- package/dist/schema/create.js +410 -222
- package/dist/schema/create.js.map +1 -1
- package/dist/schema/serialize.js +101 -0
- package/dist/schema/serialize.js.map +1 -0
- package/dist/schema-generator/schema-generator.d.ts +15 -0
- package/dist/schema-generator/schema-generator.d.ts.map +1 -0
- package/dist/shared/providers.d.ts +6 -0
- package/dist/shared/providers.d.ts.map +1 -0
- package/dist/util/import-generator.js +26 -0
- package/dist/util/import-generator.js.map +1 -0
- package/dist/util/parse.js +15 -0
- package/dist/util/parse.js.map +1 -0
- package/dist/util/types.d.ts +8 -0
- package/dist/util/types.d.ts.map +1 -0
- package/package.json +63 -2
- package/src/adapters/adapters.ts +22 -0
- package/src/adapters/drizzle/drizzle-adapter-pglite.test.ts +433 -0
- package/src/adapters/drizzle/drizzle-adapter.test.ts +122 -0
- package/src/adapters/drizzle/drizzle-adapter.ts +118 -0
- package/src/adapters/drizzle/drizzle-query.ts +234 -0
- package/src/adapters/drizzle/drizzle-uow-compiler.test.ts +1084 -0
- package/src/adapters/drizzle/drizzle-uow-compiler.ts +546 -0
- package/src/adapters/drizzle/drizzle-uow-decoder.ts +165 -0
- package/src/adapters/drizzle/drizzle-uow-executor.ts +213 -0
- package/src/adapters/drizzle/generate.test.ts +643 -0
- package/src/adapters/drizzle/generate.ts +481 -0
- package/src/adapters/drizzle/join-column-utils.test.ts +79 -0
- package/src/adapters/drizzle/join-column-utils.ts +39 -0
- package/src/adapters/drizzle/migrate-drizzle.test.ts +226 -0
- package/src/adapters/drizzle/shared.ts +22 -0
- package/src/adapters/drizzle/test-utils.ts +56 -0
- package/src/adapters/kysely/kysely-adapter-pglite.test.ts +789 -0
- package/src/adapters/kysely/kysely-adapter.ts +196 -0
- package/src/adapters/kysely/kysely-query-builder.test.ts +1344 -0
- package/src/adapters/kysely/kysely-query-builder.ts +611 -0
- package/src/adapters/kysely/kysely-query-compiler.ts +124 -0
- package/src/adapters/kysely/kysely-query.ts +254 -0
- package/src/adapters/kysely/kysely-uow-compiler.test.ts +916 -0
- package/src/adapters/kysely/kysely-uow-compiler.ts +271 -0
- package/src/adapters/kysely/kysely-uow-executor.ts +149 -0
- package/src/adapters/kysely/kysely-uow-joins.test.ts +811 -0
- package/src/adapters/kysely/migration/execute-mysql.test.ts +1173 -0
- package/src/adapters/kysely/migration/execute-postgres.test.ts +2657 -0
- package/src/adapters/kysely/migration/execute.ts +382 -0
- package/src/adapters/kysely/migration/kysely-migrator.test.ts +197 -0
- package/src/fragment.test.ts +287 -0
- package/src/fragment.ts +198 -0
- package/src/migration-engine/auto-from-schema.test.ts +118 -58
- package/src/migration-engine/auto-from-schema.ts +103 -32
- package/src/migration-engine/create.test.ts +34 -46
- package/src/migration-engine/create.ts +41 -26
- package/src/migration-engine/shared.ts +26 -6
- package/src/mod.ts +197 -1
- package/src/query/condition-builder.test.ts +379 -0
- package/src/query/condition-builder.ts +294 -0
- package/src/query/cursor.test.ts +296 -0
- package/src/query/cursor.ts +147 -0
- package/src/query/orm/orm.ts +92 -0
- package/src/query/query-type.test.ts +429 -0
- package/src/query/query.ts +200 -0
- package/src/query/result-transform.test.ts +795 -0
- package/src/query/result-transform.ts +247 -0
- package/src/query/unit-of-work-types.test.ts +192 -0
- package/src/query/unit-of-work.test.ts +947 -0
- package/src/query/unit-of-work.ts +1199 -0
- package/src/schema/create.test.ts +653 -110
- package/src/schema/create.ts +708 -337
- package/src/schema/serialize.test.ts +559 -0
- package/src/schema/serialize.ts +359 -0
- package/src/schema-generator/schema-generator.ts +12 -0
- package/src/shared/config.ts +0 -8
- package/src/util/import-generator.ts +28 -0
- package/src/util/parse.ts +16 -0
- package/src/util/types.ts +4 -0
- package/tsconfig.json +1 -1
- package/tsdown.config.ts +11 -1
- package/vitest.config.ts +3 -0
- /package/dist/{cuid.js → id.js} +0 -0
- /package/src/{cuid.ts → id.ts} +0 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { column, FragnoId } from "./create";
|
|
3
|
+
import { dbToSchemaType, deserialize, schemaToDBType, serialize } from "./serialize";
|
|
4
|
+
|
|
5
|
+
describe("serialize", () => {
|
|
6
|
+
describe("dbToSchemaType", () => {
|
|
7
|
+
describe("sqlite", () => {
|
|
8
|
+
it("should map integer types correctly", () => {
|
|
9
|
+
expect(dbToSchemaType("integer", "sqlite", {})).toEqual([
|
|
10
|
+
"bool",
|
|
11
|
+
"date",
|
|
12
|
+
"timestamp",
|
|
13
|
+
"bigint",
|
|
14
|
+
"integer",
|
|
15
|
+
]);
|
|
16
|
+
expect(dbToSchemaType("INTEGER", "sqlite", {})).toEqual([
|
|
17
|
+
"bool",
|
|
18
|
+
"date",
|
|
19
|
+
"timestamp",
|
|
20
|
+
"bigint",
|
|
21
|
+
"integer",
|
|
22
|
+
]);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should map text types correctly", () => {
|
|
26
|
+
expect(dbToSchemaType("text", "sqlite", {})).toEqual([
|
|
27
|
+
"json",
|
|
28
|
+
"string",
|
|
29
|
+
"bigint",
|
|
30
|
+
"varchar(n)",
|
|
31
|
+
]);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should map numeric types correctly", () => {
|
|
35
|
+
expect(dbToSchemaType("real", "sqlite", {})).toEqual(["decimal"]);
|
|
36
|
+
expect(dbToSchemaType("numeric", "sqlite", {})).toEqual(["decimal"]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("should map blob types correctly", () => {
|
|
40
|
+
expect(dbToSchemaType("blob", "sqlite", {})).toEqual(["bigint", "binary"]);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe("postgresql", () => {
|
|
45
|
+
it("should map decimal types correctly", () => {
|
|
46
|
+
expect(dbToSchemaType("decimal", "postgresql", {})).toEqual(["decimal"]);
|
|
47
|
+
expect(dbToSchemaType("real", "postgresql", {})).toEqual(["decimal"]);
|
|
48
|
+
expect(dbToSchemaType("numeric", "postgresql", {})).toEqual(["decimal"]);
|
|
49
|
+
expect(dbToSchemaType("double precision", "postgresql", {})).toEqual(["decimal"]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("should map timestamp types correctly", () => {
|
|
53
|
+
expect(dbToSchemaType("timestamp", "postgresql", {})).toEqual(["timestamp"]);
|
|
54
|
+
expect(dbToSchemaType("timestamptz", "postgresql", {})).toEqual(["timestamp"]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("should map varchar with length correctly", () => {
|
|
58
|
+
expect(dbToSchemaType("varchar", "postgresql", { length: 255 })).toEqual(["varchar(255)"]);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("should map varchar without length to string", () => {
|
|
62
|
+
expect(dbToSchemaType("varchar", "postgresql", {})).toEqual(["string"]);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("should map text types correctly", () => {
|
|
66
|
+
expect(dbToSchemaType("text", "postgresql", {})).toEqual(["string"]);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("should map boolean types correctly", () => {
|
|
70
|
+
expect(dbToSchemaType("boolean", "postgresql", {})).toEqual(["bool"]);
|
|
71
|
+
expect(dbToSchemaType("bool", "postgresql", {})).toEqual(["bool"]);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("should map binary types correctly", () => {
|
|
75
|
+
expect(dbToSchemaType("bytea", "postgresql", {})).toEqual(["binary"]);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe("cockroachdb", () => {
|
|
80
|
+
it("should behave like postgresql", () => {
|
|
81
|
+
expect(dbToSchemaType("timestamp", "cockroachdb", {})).toEqual(["timestamp"]);
|
|
82
|
+
expect(dbToSchemaType("text", "cockroachdb", {})).toEqual(["string"]);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe("mysql", () => {
|
|
87
|
+
it("should map boolean types correctly", () => {
|
|
88
|
+
expect(dbToSchemaType("bool", "mysql", {})).toEqual(["bool"]);
|
|
89
|
+
expect(dbToSchemaType("boolean", "mysql", {})).toEqual(["bool"]);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("should map integer types correctly", () => {
|
|
93
|
+
expect(dbToSchemaType("integer", "mysql", {})).toEqual(["integer"]);
|
|
94
|
+
expect(dbToSchemaType("int", "mysql", {})).toEqual(["integer"]);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("should map decimal types correctly", () => {
|
|
98
|
+
expect(dbToSchemaType("decimal", "mysql", {})).toEqual(["decimal"]);
|
|
99
|
+
expect(dbToSchemaType("numeric", "mysql", {})).toEqual(["decimal"]);
|
|
100
|
+
expect(dbToSchemaType("float", "mysql", {})).toEqual(["decimal"]);
|
|
101
|
+
expect(dbToSchemaType("double", "mysql", {})).toEqual(["decimal"]);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("should map datetime types correctly", () => {
|
|
105
|
+
expect(dbToSchemaType("datetime", "mysql", {})).toEqual(["timestamp"]);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("should map varchar with length correctly", () => {
|
|
109
|
+
expect(dbToSchemaType("varchar", "mysql", { length: 100 })).toEqual(["varchar(100)"]);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("should map varchar without length to string", () => {
|
|
113
|
+
expect(dbToSchemaType("varchar", "mysql", {})).toEqual(["string"]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("should map text types correctly", () => {
|
|
117
|
+
expect(dbToSchemaType("text", "mysql", {})).toEqual(["string"]);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("should map blob types correctly", () => {
|
|
121
|
+
expect(dbToSchemaType("longblob", "mysql", {})).toEqual(["binary"]);
|
|
122
|
+
expect(dbToSchemaType("blob", "mysql", {})).toEqual(["binary"]);
|
|
123
|
+
expect(dbToSchemaType("mediumblob", "mysql", {})).toEqual(["binary"]);
|
|
124
|
+
expect(dbToSchemaType("tinyblob", "mysql", {})).toEqual(["binary"]);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
describe("mssql", () => {
|
|
129
|
+
it("should map integer types correctly", () => {
|
|
130
|
+
expect(dbToSchemaType("int", "mssql", {})).toEqual(["integer"]);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("should map decimal types correctly", () => {
|
|
134
|
+
expect(dbToSchemaType("decimal", "mssql", {})).toEqual(["decimal"]);
|
|
135
|
+
expect(dbToSchemaType("float", "mssql", {})).toEqual(["decimal"]);
|
|
136
|
+
expect(dbToSchemaType("real", "mssql", {})).toEqual(["decimal"]);
|
|
137
|
+
expect(dbToSchemaType("numeric", "mssql", {})).toEqual(["decimal"]);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it("should map bit type correctly", () => {
|
|
141
|
+
expect(dbToSchemaType("bit", "mssql", {})).toEqual(["bool"]);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("should map datetime types correctly", () => {
|
|
145
|
+
expect(dbToSchemaType("datetime", "mssql", {})).toEqual(["timestamp"]);
|
|
146
|
+
expect(dbToSchemaType("datetime2", "mssql", {})).toEqual(["timestamp"]);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("should map varchar with length correctly", () => {
|
|
150
|
+
expect(dbToSchemaType("varchar", "mssql", { length: 50 })).toEqual(["varchar(50)"]);
|
|
151
|
+
expect(dbToSchemaType("nvarchar", "mssql", { length: 50 })).toEqual(["varchar(50)"]);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it("should map varchar without length to string/json", () => {
|
|
155
|
+
expect(dbToSchemaType("varchar", "mssql", {})).toEqual(["string", "json"]);
|
|
156
|
+
expect(dbToSchemaType("nvarchar", "mssql", {})).toEqual(["string", "json"]);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("should map text types correctly", () => {
|
|
160
|
+
expect(dbToSchemaType("ntext", "mssql", {})).toEqual(["string", "json"]);
|
|
161
|
+
expect(dbToSchemaType("text", "mssql", {})).toEqual(["string", "json"]);
|
|
162
|
+
expect(dbToSchemaType("varchar(max)", "mssql", {})).toEqual(["string", "json"]);
|
|
163
|
+
expect(dbToSchemaType("nvarchar(max)", "mssql", {})).toEqual(["string", "json"]);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it("should map binary types correctly", () => {
|
|
167
|
+
expect(dbToSchemaType("binary", "mssql", {})).toEqual(["binary"]);
|
|
168
|
+
expect(dbToSchemaType("varbinary", "mssql", {})).toEqual(["binary"]);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
describe("schemaToDBType", () => {
|
|
174
|
+
describe("sqlite", () => {
|
|
175
|
+
it("should convert integer types to integer", () => {
|
|
176
|
+
expect(schemaToDBType(column("integer"), "sqlite")).toBe("integer");
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it("should convert timestamp to integer", () => {
|
|
180
|
+
expect(schemaToDBType(column("timestamp"), "sqlite")).toBe("integer");
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it("should convert date to integer", () => {
|
|
184
|
+
expect(schemaToDBType(column("date"), "sqlite")).toBe("integer");
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it("should convert bool to integer", () => {
|
|
188
|
+
expect(schemaToDBType(column("bool"), "sqlite")).toBe("integer");
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it("should convert binary to blob", () => {
|
|
192
|
+
expect(schemaToDBType(column("binary"), "sqlite")).toBe("blob");
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it("should convert bigint to blob", () => {
|
|
196
|
+
expect(schemaToDBType(column("bigint"), "sqlite")).toBe("blob");
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("should convert json to text", () => {
|
|
200
|
+
expect(schemaToDBType(column("json"), "sqlite")).toBe("text");
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it("should convert string to text", () => {
|
|
204
|
+
expect(schemaToDBType(column("string"), "sqlite")).toBe("text");
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("should convert varchar to text", () => {
|
|
208
|
+
expect(schemaToDBType({ type: "varchar(255)" }, "sqlite")).toBe("text");
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("should convert decimal to real", () => {
|
|
212
|
+
expect(schemaToDBType(column("decimal"), "sqlite")).toBe("real");
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
describe("mssql", () => {
|
|
217
|
+
it("should convert bool to bit", () => {
|
|
218
|
+
expect(schemaToDBType(column("bool"), "mssql")).toBe("bit");
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
it("should convert timestamp to datetime", () => {
|
|
222
|
+
expect(schemaToDBType(column("timestamp"), "mssql")).toBe("datetime");
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it("should convert integer to int", () => {
|
|
226
|
+
expect(schemaToDBType(column("integer"), "mssql")).toBe("int");
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it("should convert string to varchar(max)", () => {
|
|
230
|
+
expect(schemaToDBType(column("string"), "mssql")).toBe("varchar(max)");
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it("should convert binary to varbinary(max)", () => {
|
|
234
|
+
expect(schemaToDBType(column("binary"), "mssql")).toBe("varbinary(max)");
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
it("should convert json to varchar(max)", () => {
|
|
238
|
+
expect(schemaToDBType(column("json"), "mssql")).toBe("varchar(max)");
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it("should preserve varchar with length", () => {
|
|
242
|
+
expect(schemaToDBType({ type: "varchar(100)" }, "mssql")).toBe("varchar(100)");
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
describe("postgresql", () => {
|
|
247
|
+
it("should convert bool to boolean", () => {
|
|
248
|
+
expect(schemaToDBType(column("bool"), "postgresql")).toBe("boolean");
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it("should convert json to json", () => {
|
|
252
|
+
expect(schemaToDBType(column("json"), "postgresql")).toBe("json");
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it("should convert string to text", () => {
|
|
256
|
+
expect(schemaToDBType(column("string"), "postgresql")).toBe("text");
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
it("should convert binary to bytea", () => {
|
|
260
|
+
expect(schemaToDBType(column("binary"), "postgresql")).toBe("bytea");
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it("should preserve varchar with length", () => {
|
|
264
|
+
expect(schemaToDBType({ type: "varchar(200)" }, "postgresql")).toBe("varchar(200)");
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it("should preserve other types", () => {
|
|
268
|
+
expect(schemaToDBType(column("timestamp"), "postgresql")).toBe("timestamp");
|
|
269
|
+
expect(schemaToDBType(column("integer"), "postgresql")).toBe("integer");
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
describe("cockroachdb", () => {
|
|
274
|
+
it("should behave like postgresql", () => {
|
|
275
|
+
expect(schemaToDBType(column("bool"), "cockroachdb")).toBe("boolean");
|
|
276
|
+
expect(schemaToDBType(column("string"), "cockroachdb")).toBe("text");
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
describe("mysql", () => {
|
|
281
|
+
it("should convert bool to boolean", () => {
|
|
282
|
+
expect(schemaToDBType(column("bool"), "mysql")).toBe("boolean");
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it("should convert string to text", () => {
|
|
286
|
+
expect(schemaToDBType(column("string"), "mysql")).toBe("text");
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it("should convert binary to longblob", () => {
|
|
290
|
+
expect(schemaToDBType(column("binary"), "mysql")).toBe("longblob");
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it("should preserve varchar with length", () => {
|
|
294
|
+
expect(schemaToDBType({ type: "varchar(150)" }, "mysql")).toBe("varchar(150)");
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it("should preserve other types", () => {
|
|
298
|
+
expect(schemaToDBType(column("integer"), "mysql")).toBe("integer");
|
|
299
|
+
expect(schemaToDBType(column("json"), "mysql")).toBe("json");
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
describe("deserialize", () => {
|
|
305
|
+
it("should return null for null values", () => {
|
|
306
|
+
expect(deserialize(null, column("string"), "sqlite")).toBe(null);
|
|
307
|
+
expect(deserialize(null, column("integer"), "postgresql")).toBe(null);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
describe("json handling", () => {
|
|
311
|
+
it("should parse JSON strings for non-json-supporting providers", () => {
|
|
312
|
+
const jsonCol = column("json");
|
|
313
|
+
const jsonString = '{"key":"value"}';
|
|
314
|
+
expect(deserialize(jsonString, jsonCol, "sqlite")).toEqual({ key: "value" });
|
|
315
|
+
expect(deserialize(jsonString, jsonCol, "mssql")).toEqual({ key: "value" });
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
it("should not parse JSON for json-supporting providers", () => {
|
|
319
|
+
const jsonCol = column("json");
|
|
320
|
+
const jsonObj = { key: "value" };
|
|
321
|
+
expect(deserialize(jsonObj, jsonCol, "postgresql")).toEqual(jsonObj);
|
|
322
|
+
expect(deserialize(jsonObj, jsonCol, "mysql")).toEqual(jsonObj);
|
|
323
|
+
expect(deserialize(jsonObj, jsonCol, "cockroachdb")).toEqual(jsonObj);
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
describe("sqlite date handling", () => {
|
|
328
|
+
it("should convert numeric timestamps to Date", () => {
|
|
329
|
+
const timestampCol = column("timestamp");
|
|
330
|
+
const time = Date.now();
|
|
331
|
+
expect(deserialize(time, timestampCol, "sqlite")).toEqual(new Date(time));
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it("should convert string timestamps to Date", () => {
|
|
335
|
+
const timestampCol = column("timestamp");
|
|
336
|
+
const time = "2024-01-01T00:00:00.000Z";
|
|
337
|
+
expect(deserialize(time, timestampCol, "sqlite")).toEqual(new Date(time));
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
it("should convert date values", () => {
|
|
341
|
+
const dateCol = column("date");
|
|
342
|
+
const time = Date.now();
|
|
343
|
+
expect(deserialize(time, dateCol, "sqlite")).toEqual(new Date(time));
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
describe("boolean handling", () => {
|
|
348
|
+
it("should convert numeric booleans", () => {
|
|
349
|
+
const boolCol = column("bool");
|
|
350
|
+
expect(deserialize(1, boolCol, "sqlite")).toBe(true);
|
|
351
|
+
expect(deserialize(0, boolCol, "sqlite")).toBe(false);
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it("should handle actual boolean values", () => {
|
|
355
|
+
const boolCol = column("bool");
|
|
356
|
+
expect(deserialize(true, boolCol, "postgresql")).toBe(true);
|
|
357
|
+
expect(deserialize(false, boolCol, "postgresql")).toBe(false);
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
describe("bigint handling", () => {
|
|
362
|
+
it("should convert Buffer to bigint", () => {
|
|
363
|
+
const bigintCol = column("bigint");
|
|
364
|
+
const buffer = Buffer.alloc(8);
|
|
365
|
+
buffer.writeBigInt64BE(123456789n);
|
|
366
|
+
expect(deserialize(buffer, bigintCol, "sqlite")).toBe(123456789n);
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
it("should convert string to bigint", () => {
|
|
370
|
+
const bigintCol = column("bigint");
|
|
371
|
+
expect(deserialize("123456789", bigintCol, "postgresql")).toBe(123456789n);
|
|
372
|
+
expect(deserialize("987654321", bigintCol, "mysql")).toBe(987654321n);
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
it("should handle bigint passthrough", () => {
|
|
376
|
+
const bigintCol = column("bigint");
|
|
377
|
+
const value = 123456789n;
|
|
378
|
+
expect(deserialize(value, bigintCol, "postgresql")).toBe(value);
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
describe("binary handling", () => {
|
|
383
|
+
it("should convert Buffer to Uint8Array", () => {
|
|
384
|
+
const binaryCol = column("binary");
|
|
385
|
+
const buffer = Buffer.from([1, 2, 3, 4]);
|
|
386
|
+
const result = deserialize(buffer, binaryCol, "postgresql");
|
|
387
|
+
expect(result).toBeInstanceOf(Uint8Array);
|
|
388
|
+
expect(Array.from(result as Uint8Array)).toEqual([1, 2, 3, 4]);
|
|
389
|
+
});
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
describe("serialize", () => {
|
|
394
|
+
it("should return null for null values", () => {
|
|
395
|
+
expect(serialize(null, column("string"), "sqlite")).toBe(null);
|
|
396
|
+
expect(serialize(null, column("integer"), "postgresql")).toBe(null);
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
describe("json handling", () => {
|
|
400
|
+
it("should stringify JSON for non-json-supporting providers", () => {
|
|
401
|
+
const jsonCol = column("json");
|
|
402
|
+
const obj = { key: "value" };
|
|
403
|
+
expect(serialize(obj, jsonCol, "sqlite")).toBe('{"key":"value"}');
|
|
404
|
+
expect(serialize(obj, jsonCol, "mssql")).toBe('{"key":"value"}');
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
it("should not stringify JSON for json-supporting providers", () => {
|
|
408
|
+
const jsonCol = column("json");
|
|
409
|
+
const obj = { key: "value" };
|
|
410
|
+
expect(serialize(obj, jsonCol, "postgresql")).toEqual(obj);
|
|
411
|
+
expect(serialize(obj, jsonCol, "mysql")).toEqual(obj);
|
|
412
|
+
expect(serialize(obj, jsonCol, "cockroachdb")).toEqual(obj);
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
describe("sqlite date handling", () => {
|
|
417
|
+
it("should convert Date to timestamp number", () => {
|
|
418
|
+
const date = new Date("2024-01-01T00:00:00.000Z");
|
|
419
|
+
expect(serialize(date, column("timestamp"), "sqlite")).toBe(date.getTime());
|
|
420
|
+
expect(serialize(date, column("date"), "sqlite")).toBe(date.getTime());
|
|
421
|
+
});
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
describe("sqlite boolean handling", () => {
|
|
425
|
+
it("should convert boolean to number", () => {
|
|
426
|
+
expect(serialize(true, column("bool"), "sqlite")).toBe(1);
|
|
427
|
+
expect(serialize(false, column("bool"), "sqlite")).toBe(0);
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
it("should not convert boolean for other providers", () => {
|
|
431
|
+
expect(serialize(true, column("bool"), "postgresql")).toBe(true);
|
|
432
|
+
expect(serialize(false, column("bool"), "mysql")).toBe(false);
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
describe("sqlite bigint handling", () => {
|
|
437
|
+
it("should convert bigint to Buffer", () => {
|
|
438
|
+
const bigintValue = 123456789n;
|
|
439
|
+
const result = serialize(bigintValue, column("bigint"), "sqlite");
|
|
440
|
+
expect(result).toBeInstanceOf(Buffer);
|
|
441
|
+
expect((result as Buffer).readBigInt64BE(0)).toBe(bigintValue);
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
describe("binary handling", () => {
|
|
446
|
+
it("should convert Uint8Array to Buffer", () => {
|
|
447
|
+
const binaryCol = column("binary");
|
|
448
|
+
const uint8 = new Uint8Array([1, 2, 3, 4]);
|
|
449
|
+
const result = serialize(uint8, binaryCol, "postgresql");
|
|
450
|
+
expect(result).toBeInstanceOf(Buffer);
|
|
451
|
+
expect(Array.from(result as Buffer)).toEqual([1, 2, 3, 4]);
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
it("should handle Buffer as-is", () => {
|
|
455
|
+
const binaryCol = column("binary");
|
|
456
|
+
const buffer = Buffer.from([1, 2, 3, 4]);
|
|
457
|
+
const result = serialize(buffer, binaryCol, "mysql");
|
|
458
|
+
// Buffer is also a Uint8Array, so it should be converted
|
|
459
|
+
expect(result).toBeInstanceOf(Buffer);
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
describe("passthrough values", () => {
|
|
464
|
+
it("should pass through values that don't need conversion", () => {
|
|
465
|
+
expect(serialize("test", column("string"), "postgresql")).toBe("test");
|
|
466
|
+
expect(serialize(42, column("integer"), "mysql")).toBe(42);
|
|
467
|
+
expect(serialize(3.14, column("decimal"), "mssql")).toBe(3.14);
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
describe("FragnoId handling", () => {
|
|
472
|
+
it("should serialize FragnoId for external-id column", () => {
|
|
473
|
+
const externalIdCol = column("string");
|
|
474
|
+
externalIdCol.role = "external-id";
|
|
475
|
+
const fragnoId = FragnoId.fromExternal("user123", 0);
|
|
476
|
+
|
|
477
|
+
expect(serialize(fragnoId, externalIdCol, "postgresql")).toBe("user123");
|
|
478
|
+
expect(serialize(fragnoId, externalIdCol, "sqlite")).toBe("user123");
|
|
479
|
+
expect(serialize(fragnoId, externalIdCol, "mysql")).toBe("user123");
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
it("should serialize FragnoId for internal-id column", () => {
|
|
483
|
+
const internalIdCol = column("bigint");
|
|
484
|
+
internalIdCol.role = "internal-id";
|
|
485
|
+
const fragnoId = new FragnoId({
|
|
486
|
+
externalId: "user123",
|
|
487
|
+
internalId: BigInt(456),
|
|
488
|
+
version: 0,
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
expect(serialize(fragnoId, internalIdCol, "postgresql")).toBe(BigInt(456));
|
|
492
|
+
expect(serialize(fragnoId, internalIdCol, "sqlite")).toBe(BigInt(456));
|
|
493
|
+
expect(serialize(fragnoId, internalIdCol, "mysql")).toBe(BigInt(456));
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
it("should throw error when FragnoId lacks internal ID for internal-id column", () => {
|
|
497
|
+
const internalIdCol = column("bigint");
|
|
498
|
+
internalIdCol.role = "internal-id";
|
|
499
|
+
const fragnoId = FragnoId.fromExternal("user123", 0);
|
|
500
|
+
|
|
501
|
+
expect(() => serialize(fragnoId, internalIdCol, "postgresql")).toThrow(
|
|
502
|
+
"FragnoId must have internalId for internal-id column",
|
|
503
|
+
);
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
it("should serialize FragnoId for reference column (prefer internal ID)", () => {
|
|
507
|
+
const referenceCol = column("bigint");
|
|
508
|
+
referenceCol.role = "reference";
|
|
509
|
+
const fragnoId = new FragnoId({
|
|
510
|
+
externalId: "user123",
|
|
511
|
+
internalId: BigInt(456),
|
|
512
|
+
version: 0,
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
expect(serialize(fragnoId, referenceCol, "postgresql")).toBe(BigInt(456));
|
|
516
|
+
expect(serialize(fragnoId, referenceCol, "sqlite")).toBe(BigInt(456));
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
it("should fallback to external ID for reference column when internal ID unavailable", () => {
|
|
520
|
+
const referenceCol = column("bigint");
|
|
521
|
+
referenceCol.role = "reference";
|
|
522
|
+
const fragnoId = FragnoId.fromExternal("user123", 0);
|
|
523
|
+
|
|
524
|
+
expect(serialize(fragnoId, referenceCol, "postgresql")).toBe("user123");
|
|
525
|
+
expect(serialize(fragnoId, referenceCol, "sqlite")).toBe("user123");
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
it("should serialize FragnoId for regular column (use external ID)", () => {
|
|
529
|
+
const regularCol = column("string");
|
|
530
|
+
regularCol.role = "regular";
|
|
531
|
+
const fragnoId = new FragnoId({
|
|
532
|
+
externalId: "user123",
|
|
533
|
+
internalId: BigInt(456),
|
|
534
|
+
version: 0,
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
expect(serialize(fragnoId, regularCol, "postgresql")).toBe("user123");
|
|
538
|
+
expect(serialize(fragnoId, regularCol, "mysql")).toBe("user123");
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
it("should handle FragnoId serialization with different providers", () => {
|
|
542
|
+
const externalIdCol = column("string");
|
|
543
|
+
externalIdCol.role = "external-id";
|
|
544
|
+
const fragnoId = new FragnoId({
|
|
545
|
+
externalId: "user123",
|
|
546
|
+
internalId: BigInt(456),
|
|
547
|
+
version: 0,
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
// Test across different providers
|
|
551
|
+
expect(serialize(fragnoId, externalIdCol, "sqlite")).toBe("user123");
|
|
552
|
+
expect(serialize(fragnoId, externalIdCol, "postgresql")).toBe("user123");
|
|
553
|
+
expect(serialize(fragnoId, externalIdCol, "mysql")).toBe("user123");
|
|
554
|
+
expect(serialize(fragnoId, externalIdCol, "mssql")).toBe("user123");
|
|
555
|
+
expect(serialize(fragnoId, externalIdCol, "cockroachdb")).toBe("user123");
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
});
|