drizzle-sybase 1.3.0 → 2.0.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.
Files changed (82) hide show
  1. package/README.md +151 -3
  2. package/dist/codecs.d.ts +54 -0
  3. package/dist/codecs.d.ts.map +1 -0
  4. package/dist/codecs.js +112 -0
  5. package/dist/codecs.js.map +1 -0
  6. package/dist/columns/index.d.ts +16 -6
  7. package/dist/columns/index.d.ts.map +1 -1
  8. package/dist/columns/index.js +52 -35
  9. package/dist/columns/index.js.map +1 -1
  10. package/dist/connection.d.ts +20 -0
  11. package/dist/connection.d.ts.map +1 -1
  12. package/dist/connection.js +9 -1
  13. package/dist/connection.js.map +1 -1
  14. package/dist/datetime.d.ts +69 -0
  15. package/dist/datetime.d.ts.map +1 -0
  16. package/dist/datetime.js +384 -0
  17. package/dist/datetime.js.map +1 -0
  18. package/dist/db.d.ts +8 -1
  19. package/dist/db.d.ts.map +1 -1
  20. package/dist/db.js +22 -39
  21. package/dist/db.js.map +1 -1
  22. package/dist/dialect.d.ts +24 -2
  23. package/dist/dialect.d.ts.map +1 -1
  24. package/dist/dialect.js +46 -10
  25. package/dist/dialect.js.map +1 -1
  26. package/dist/index.d.ts +3 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +4 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/introspect/codegen.d.ts.map +1 -1
  31. package/dist/introspect/codegen.js +99 -32
  32. package/dist/introspect/codegen.js.map +1 -1
  33. package/dist/introspect/type-map.d.ts +64 -1
  34. package/dist/introspect/type-map.d.ts.map +1 -1
  35. package/dist/introspect/type-map.js +56 -5
  36. package/dist/introspect/type-map.js.map +1 -1
  37. package/dist/native/index.d.ts +2 -0
  38. package/dist/native/index.d.ts.map +1 -1
  39. package/dist/native/index.js.map +1 -1
  40. package/dist/native/sybase_native.darwin-arm64.node +0 -0
  41. package/dist/native/sybase_native.darwin-x64.node +0 -0
  42. package/dist/native/sybase_native.linux-arm64.node +0 -0
  43. package/dist/native/sybase_native.linux-x64.node +0 -0
  44. package/dist/native/sybase_native.win32-x64.node +0 -0
  45. package/dist/query-builders/insert.d.ts +9 -0
  46. package/dist/query-builders/insert.d.ts.map +1 -1
  47. package/dist/query-builders/insert.js +11 -2
  48. package/dist/query-builders/insert.js.map +1 -1
  49. package/dist/session.d.ts +4 -2
  50. package/dist/session.d.ts.map +1 -1
  51. package/dist/session.js +38 -17
  52. package/dist/session.js.map +1 -1
  53. package/package.json +11 -10
  54. package/src/native/binding.c +204 -11
  55. package/dist/__tests__/dialect.test.d.ts +0 -2
  56. package/dist/__tests__/dialect.test.d.ts.map +0 -1
  57. package/dist/__tests__/dialect.test.js +0 -50
  58. package/dist/__tests__/dialect.test.js.map +0 -1
  59. package/dist/__tests__/errors.test.d.ts +0 -2
  60. package/dist/__tests__/errors.test.d.ts.map +0 -1
  61. package/dist/__tests__/errors.test.js +0 -75
  62. package/dist/__tests__/errors.test.js.map +0 -1
  63. package/dist/__tests__/integration.test.d.ts +0 -2
  64. package/dist/__tests__/integration.test.d.ts.map +0 -1
  65. package/dist/__tests__/integration.test.js +0 -119
  66. package/dist/__tests__/integration.test.js.map +0 -1
  67. package/dist/__tests__/pool.test.d.ts +0 -2
  68. package/dist/__tests__/pool.test.d.ts.map +0 -1
  69. package/dist/__tests__/pool.test.js +0 -194
  70. package/dist/__tests__/pool.test.js.map +0 -1
  71. package/dist/introspect/__tests__/introspect.test.d.ts +0 -2
  72. package/dist/introspect/__tests__/introspect.test.d.ts.map +0 -1
  73. package/dist/introspect/__tests__/introspect.test.js +0 -411
  74. package/dist/introspect/__tests__/introspect.test.js.map +0 -1
  75. package/dist/native/__tests__/native.test.d.ts +0 -2
  76. package/dist/native/__tests__/native.test.d.ts.map +0 -1
  77. package/dist/native/__tests__/native.test.js +0 -25
  78. package/dist/native/__tests__/native.test.js.map +0 -1
  79. package/dist/query-builders/__tests__/query-builders.test.d.ts +0 -2
  80. package/dist/query-builders/__tests__/query-builders.test.d.ts.map +0 -1
  81. package/dist/query-builders/__tests__/query-builders.test.js +0 -477
  82. package/dist/query-builders/__tests__/query-builders.test.js.map +0 -1
@@ -1,194 +0,0 @@
1
- /**
2
- * Error hierarchy and pool behavior unit tests.
3
- * These tests verify error types and pool logic without requiring a real Sybase connection.
4
- */
5
- import { describe, it, expect } from "vitest";
6
- import { SybasePool } from "../connection.js";
7
- import { SybaseError, SybaseConnectionError, SybaseQueryError, SybaseTimeoutError, SybasePoolError } from "../errors.js";
8
- // ---------------------------------------------------------------------------
9
- // Error hierarchy tests
10
- // ---------------------------------------------------------------------------
11
- describe("SybaseError hierarchy", () => {
12
- it("SybaseError is a base Error", () => {
13
- const err = new SybaseError("test error");
14
- expect(err).toBeInstanceOf(Error);
15
- expect(err).toBeInstanceOf(SybaseError);
16
- expect(err.name).toBe("SybaseError");
17
- expect(err.message).toBe("test error");
18
- expect(err.connectionDead).toBe(false);
19
- });
20
- it("SybaseError parses Sybase message format", () => {
21
- const err = new SybaseError("Msg 208, Level 16, State 1: Invalid object name 'foo'");
22
- expect(err.msgNo).toBe(208);
23
- expect(err.severity).toBe(16);
24
- });
25
- it("SybaseConnectionError extends SybaseError", () => {
26
- const err = new SybaseConnectionError("conn failed", { host: "localhost", port: 5000 });
27
- expect(err).toBeInstanceOf(Error);
28
- expect(err).toBeInstanceOf(SybaseError);
29
- expect(err).toBeInstanceOf(SybaseConnectionError);
30
- expect(err.name).toBe("SybaseConnectionError");
31
- expect(err.connectionDead).toBe(true);
32
- expect(err.host).toBe("localhost");
33
- expect(err.port).toBe(5000);
34
- });
35
- it("SybaseQueryError extends SybaseError", () => {
36
- const err = new SybaseQueryError("syntax error", { sql: "SELCT 1" });
37
- expect(err).toBeInstanceOf(Error);
38
- expect(err).toBeInstanceOf(SybaseError);
39
- expect(err).toBeInstanceOf(SybaseQueryError);
40
- expect(err.name).toBe("SybaseQueryError");
41
- expect(err.connectionDead).toBe(false);
42
- expect(err.sql).toBe("SELCT 1");
43
- });
44
- it("SybaseQueryError truncates long SQL", () => {
45
- const longSql = "SELECT " + "x".repeat(500);
46
- const err = new SybaseQueryError("error", { sql: longSql });
47
- expect(err.sql.length).toBe(200);
48
- });
49
- it("SybaseTimeoutError extends SybaseError", () => {
50
- const err = new SybaseTimeoutError("timed out", "acquire", 10000);
51
- expect(err).toBeInstanceOf(Error);
52
- expect(err).toBeInstanceOf(SybaseError);
53
- expect(err).toBeInstanceOf(SybaseTimeoutError);
54
- expect(err.name).toBe("SybaseTimeoutError");
55
- expect(err.operation).toBe("acquire");
56
- expect(err.timeoutMs).toBe(10000);
57
- });
58
- it("SybasePoolError extends SybaseError", () => {
59
- const err = new SybasePoolError("pool closed", "closed");
60
- expect(err).toBeInstanceOf(Error);
61
- expect(err).toBeInstanceOf(SybaseError);
62
- expect(err).toBeInstanceOf(SybasePoolError);
63
- expect(err.name).toBe("SybasePoolError");
64
- expect(err.poolState).toBe("closed");
65
- expect(err.connectionDead).toBe(false);
66
- });
67
- });
68
- // ---------------------------------------------------------------------------
69
- // Pool state tests (no real connections)
70
- // ---------------------------------------------------------------------------
71
- describe("SybasePool state management", () => {
72
- it("starts with correct initial state", () => {
73
- const pool = new SybasePool({
74
- host: "localhost",
75
- port: 5000,
76
- database: "test",
77
- username: "sa",
78
- password: "pass",
79
- max: 10
80
- });
81
- expect(pool.size).toBe(0);
82
- expect(pool.idle).toBe(0);
83
- expect(pool.active).toBe(0);
84
- expect(pool.waiting).toBe(0);
85
- expect(pool.isDraining).toBe(false);
86
- expect(pool.isClosed).toBe(false);
87
- void pool.close();
88
- });
89
- it("reports closed state after close()", async () => {
90
- const pool = new SybasePool({
91
- host: "localhost",
92
- port: 5000,
93
- database: "test",
94
- username: "sa",
95
- password: "pass"
96
- });
97
- await pool.close();
98
- expect(pool.isClosed).toBe(true);
99
- });
100
- it("rejects acquire after close()", async () => {
101
- const pool = new SybasePool({
102
- host: "localhost",
103
- port: 5000,
104
- database: "test",
105
- username: "sa",
106
- password: "pass"
107
- });
108
- await pool.close();
109
- try {
110
- await pool.acquire();
111
- expect.fail("Should have thrown");
112
- }
113
- catch (err) {
114
- expect(err).toBeInstanceOf(SybasePoolError);
115
- expect(err.poolState).toBe("closed");
116
- }
117
- });
118
- it("rejects acquire after drain()", async () => {
119
- const pool = new SybasePool({
120
- host: "localhost",
121
- port: 5000,
122
- database: "test",
123
- username: "sa",
124
- password: "pass"
125
- });
126
- // drain should complete immediately when no active connections
127
- await pool.drain();
128
- try {
129
- await pool.acquire();
130
- expect.fail("Should have thrown");
131
- }
132
- catch (err) {
133
- expect(err).toBeInstanceOf(SybasePoolError);
134
- }
135
- });
136
- it("provides initial metrics", () => {
137
- const pool = new SybasePool({
138
- host: "localhost",
139
- port: 5000,
140
- database: "test",
141
- username: "sa",
142
- password: "pass"
143
- });
144
- const metrics = pool.metrics;
145
- expect(metrics.totalConnectionsCreated).toBe(0);
146
- expect(metrics.totalConnectionsDestroyed).toBe(0);
147
- expect(metrics.totalQueriesExecuted).toBe(0);
148
- expect(metrics.totalQueryErrors).toBe(0);
149
- expect(metrics.totalAcquireTimeouts).toBe(0);
150
- expect(metrics.avgQueryDurationMs).toBe(0);
151
- expect(metrics.currentSize).toBe(0);
152
- expect(metrics.currentActive).toBe(0);
153
- expect(metrics.currentIdle).toBe(0);
154
- expect(metrics.currentWaiting).toBe(0);
155
- void pool.close();
156
- });
157
- it("rejects with SybaseConnectionError for invalid host", async () => {
158
- const pool = new SybasePool({
159
- host: "127.0.0.1",
160
- port: 1, // Port 1 — no service listening, TCP RST immediately
161
- database: "nope",
162
- username: "nobody",
163
- password: "wrong",
164
- max: 1,
165
- timeout: 2,
166
- retries: 0
167
- });
168
- try {
169
- await pool.query("SELECT 1");
170
- expect.fail("Should have thrown");
171
- }
172
- catch (err) {
173
- expect(err).toBeInstanceOf(SybaseError);
174
- expect(err).toBeInstanceOf(SybaseConnectionError);
175
- }
176
- finally {
177
- await pool.close();
178
- }
179
- }, 15000);
180
- it("acquire timeout throws SybaseTimeoutError", async () => {
181
- // We can't easily test actual acquire timeout without mocking native,
182
- // but we verify the pool validates configuration
183
- expect(() => new SybasePool({
184
- host: "localhost",
185
- port: 9999,
186
- database: "nope",
187
- username: "nobody",
188
- password: "wrong",
189
- max: 0,
190
- timeout: 1
191
- })).toThrow("Pool max must be at least 1");
192
- });
193
- });
194
- //# sourceMappingURL=pool.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool.test.js","sourceRoot":"","sources":["../../src/__tests__/pool.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,CAAC;QAC1C,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACvC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,GAAG,GAAG,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AAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,sEAAsE;QACtE,iDAAiD;QACjD,MAAM,CACJ,GAAG,EAAE,CACH,IAAI,UAAU,CAAC;YACb,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,MAAM;YAChB,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,OAAO;YACjB,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,CAAC;SACX,CAAC,CACL,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=introspect.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"introspect.test.d.ts","sourceRoot":"","sources":["../../../src/introspect/__tests__/introspect.test.ts"],"names":[],"mappings":""}
@@ -1,411 +0,0 @@
1
- /**
2
- * Introspection unit tests.
3
- *
4
- * These verify catalog query construction, metadata parsing and code
5
- * generation without requiring a real Sybase connection, using a mock db that
6
- * captures executed SQL and returns scripted rows (mirroring the mock style of
7
- * the query-builder tests).
8
- */
9
- import { describe, it, expect } from "vitest";
10
- import { generateSchemaCode, toCamelCase } from "../codegen.js";
11
- import { assertSafeIdentifier, fetchColumns, fetchIndexes, fetchTables } from "../fetch.js";
12
- import { introspectWith, runCli } from "../index.js";
13
- import { resolveMapping, SYBASE_TYPE_MAP } from "../type-map.js";
14
- function createMockDb(responder) {
15
- const executed = [];
16
- const db = {
17
- executed,
18
- async executeRaw(rawSql) {
19
- executed.push(rawSql);
20
- const rows = responder(rawSql);
21
- return { rows, rowCount: rows.length };
22
- }
23
- };
24
- return db;
25
- }
26
- // ---------------------------------------------------------------------------
27
- // type-map (single source of truth)
28
- // ---------------------------------------------------------------------------
29
- describe("type-map", () => {
30
- it("maps known types to the matching column factory", () => {
31
- expect(SYBASE_TYPE_MAP.int.factory).toBe("int");
32
- expect(SYBASE_TYPE_MAP.varchar.size).toBe("length");
33
- expect(SYBASE_TYPE_MAP.numeric.size).toBe("precision");
34
- expect(SYBASE_TYPE_MAP.decimal.factory).toBe("numeric");
35
- expect(SYBASE_TYPE_MAP.bit.value).toBe("boolean");
36
- expect(SYBASE_TYPE_MAP.image.value).toBe("buffer");
37
- });
38
- it("flags national char types for byte-length halving", () => {
39
- expect(SYBASE_TYPE_MAP.nvarchar.nationalChar).toBe(true);
40
- expect(SYBASE_TYPE_MAP.nchar.nationalChar).toBe(true);
41
- expect(SYBASE_TYPE_MAP.varchar.nationalChar).toBeUndefined();
42
- });
43
- it("falls back to varchar for unknown types", () => {
44
- const { mapping, isFallback } = resolveMapping("xmltype");
45
- expect(isFallback).toBe(true);
46
- expect(mapping.factory).toBe("varchar");
47
- });
48
- it("does not resolve inherited Object prototype keys as types", () => {
49
- for (const key of ["constructor", "toString", "hasOwnProperty", "__proto__"]) {
50
- const { mapping, isFallback } = resolveMapping(key);
51
- expect(isFallback).toBe(true);
52
- expect(mapping.factory).toBe("varchar");
53
- }
54
- });
55
- });
56
- // ---------------------------------------------------------------------------
57
- // toCamelCase
58
- // ---------------------------------------------------------------------------
59
- describe("toCamelCase", () => {
60
- it("converts snake/upper case", () => {
61
- expect(toCamelCase("WORK_REG_BATCH")).toBe("workRegBatch");
62
- expect(toCamelCase("PDOF")).toBe("pdof");
63
- expect(toCamelCase("right_holder_id")).toBe("rightHolderId");
64
- });
65
- it("preserves a leading underscore instead of swallowing it", () => {
66
- expect(toCamelCase("_INTERNAL")).toBe("_internal");
67
- expect(toCamelCase("__x")).toBe("__x");
68
- });
69
- });
70
- // ---------------------------------------------------------------------------
71
- // assertSafeIdentifier
72
- // ---------------------------------------------------------------------------
73
- describe("assertSafeIdentifier", () => {
74
- it("accepts valid identifiers", () => {
75
- expect(() => assertSafeIdentifier("my_table1", "table")).not.toThrow();
76
- });
77
- it("rejects injection attempts and empties", () => {
78
- expect(() => assertSafeIdentifier("a'; DROP TABLE x--", "table")).toThrow(/Unsafe table/);
79
- expect(() => assertSafeIdentifier("", "table")).toThrow();
80
- expect(() => assertSafeIdentifier(undefined, "owner")).toThrow();
81
- expect(() => assertSafeIdentifier("a".repeat(129), "table")).toThrow();
82
- });
83
- });
84
- // ---------------------------------------------------------------------------
85
- // fetchTables
86
- // ---------------------------------------------------------------------------
87
- describe("fetchTables", () => {
88
- it("queries sysobjects and maps rows", async () => {
89
- const db = createMockDb(() => [{ name: "USERS", owner: "dbo" }]);
90
- const tables = await fetchTables(db, "mydb", undefined, undefined);
91
- expect(tables).toEqual([{ name: "USERS", owner: "dbo" }]);
92
- expect(db.executed[0]).toContain("mydb..sysobjects");
93
- expect(db.executed[0]).toContain("o.type = 'U'");
94
- });
95
- it("applies table and owner filters with escaped literals", async () => {
96
- const db = createMockDb(() => []);
97
- await fetchTables(db, "mydb", ["A", "B"], "dbo");
98
- expect(db.executed[0]).toContain("o.name IN ('A', 'B')");
99
- expect(db.executed[0]).toContain("u.name = 'dbo'");
100
- });
101
- it("validates identifiers before querying", async () => {
102
- const db = createMockDb(() => []);
103
- await expect(fetchTables(db, "bad db", undefined)).rejects.toThrow(/Unsafe database/);
104
- await expect(fetchTables(db, "mydb", ["ok", "no;drop"])).rejects.toThrow(/Unsafe table/);
105
- });
106
- it("defaults a missing owner to empty string", async () => {
107
- const db = createMockDb(() => [{ name: "T", owner: null }]);
108
- const tables = await fetchTables(db, "mydb");
109
- expect(tables[0].owner).toBe("");
110
- });
111
- });
112
- // ---------------------------------------------------------------------------
113
- // fetchColumns
114
- // ---------------------------------------------------------------------------
115
- describe("fetchColumns", () => {
116
- it("parses nullability/identity bit masks and joins defaults", async () => {
117
- const db = createMockDb(sql => {
118
- if (sql.includes("syscomments")) {
119
- return [{ col_name: "STATUS", default_text: " 'A' " }];
120
- }
121
- return [
122
- { name: "ID", colid: 1, type_name: "INT", length: 4, prec: null, scale: null, status: 128 },
123
- {
124
- name: "NAME",
125
- colid: 2,
126
- type_name: "VARCHAR",
127
- length: 50,
128
- prec: null,
129
- scale: null,
130
- status: 8
131
- },
132
- {
133
- name: "STATUS",
134
- colid: 3,
135
- type_name: "CHAR",
136
- length: 1,
137
- prec: null,
138
- scale: null,
139
- status: 0
140
- }
141
- ];
142
- });
143
- const cols = await fetchColumns(db, "mydb", "USERS");
144
- expect(cols[0]).toMatchObject({
145
- name: "ID",
146
- typeName: "int",
147
- isIdentity: true,
148
- isNullable: false
149
- });
150
- expect(cols[1]).toMatchObject({ name: "NAME", typeName: "varchar", isNullable: true });
151
- expect(cols[2]).toMatchObject({ name: "STATUS", defaultValue: "'A'", isNullable: false });
152
- });
153
- it("throws when the base system type cannot be resolved", async () => {
154
- const db = createMockDb(sql => {
155
- if (sql.includes("syscomments")) {
156
- return [];
157
- }
158
- return [
159
- { name: "C", colid: 1, type_name: null, length: 0, prec: null, scale: null, status: 0 }
160
- ];
161
- });
162
- await expect(fetchColumns(db, "mydb", "T")).rejects.toThrow(/base system type/);
163
- });
164
- });
165
- // ---------------------------------------------------------------------------
166
- // fetchIndexes (single round-trip per index)
167
- // ---------------------------------------------------------------------------
168
- describe("fetchIndexes", () => {
169
- it("resolves all key columns in one query per index", async () => {
170
- const indexColQueries = [];
171
- const db = createMockDb(sql => {
172
- if (sql.includes("sysindexes") && sql.includes("keycnt")) {
173
- return [{ index_name: "pk_users", indid: 1, status: 2 | 2048, keycnt: 2 }];
174
- }
175
- if (sql.includes("index_col")) {
176
- indexColQueries.push(sql);
177
- return [
178
- { keyno: 1, col_name: "TENANT_ID" },
179
- { keyno: 2, col_name: "ID" }
180
- ];
181
- }
182
- return [];
183
- });
184
- const indexes = await fetchIndexes(db, "mydb", "USERS");
185
- expect(indexes).toHaveLength(1);
186
- expect(indexes[0]).toMatchObject({
187
- isPrimary: true,
188
- isUnique: true,
189
- columns: ["TENANT_ID", "ID"]
190
- });
191
- // Exactly one round-trip for the two key columns (not one per column).
192
- expect(indexColQueries).toHaveLength(1);
193
- expect(indexColQueries[0]).toContain("UNION ALL");
194
- });
195
- it("stops at the first null key column", async () => {
196
- const db = createMockDb(sql => {
197
- if (sql.includes("keycnt")) {
198
- return [{ index_name: "ix", indid: 2, status: 0, keycnt: 3 }];
199
- }
200
- if (sql.includes("index_col")) {
201
- return [
202
- { keyno: 1, col_name: "A" },
203
- { keyno: 2, col_name: null },
204
- { keyno: 3, col_name: "C" }
205
- ];
206
- }
207
- return [];
208
- });
209
- const indexes = await fetchIndexes(db, "mydb", "T");
210
- expect(indexes[0].columns).toEqual(["A"]);
211
- });
212
- });
213
- // ---------------------------------------------------------------------------
214
- // generateSchemaCode
215
- // ---------------------------------------------------------------------------
216
- function col(overrides) {
217
- return {
218
- colid: 1,
219
- length: 0,
220
- precision: null,
221
- scale: null,
222
- isNullable: false,
223
- isIdentity: false,
224
- defaultValue: null,
225
- ...overrides
226
- };
227
- }
228
- function table(name, columns, indexes = []) {
229
- return { name, owner: "dbo", columns, indexes };
230
- }
231
- describe("generateSchemaCode", () => {
232
- it("emits a single-column primary key inline", () => {
233
- const t = table("USERS", [
234
- col({ name: "ID", typeName: "int", isIdentity: true }),
235
- col({ name: "NAME", typeName: "varchar", length: 50, isNullable: true })
236
- ], [{ indexName: "pk_users", isPrimary: true, isUnique: true, columns: ["ID"] }]);
237
- const { code } = generateSchemaCode([t], "mydb");
238
- expect(code).toContain('export const users = sybaseTable("USERS"');
239
- expect(code).toContain('id: int("ID").identity().notNull().primaryKey()');
240
- expect(code).toContain('name: varchar("NAME", { length: 50 })');
241
- expect(code).toContain("import { sybaseTable, int, varchar }");
242
- });
243
- it("preserves composite primary keys via comment and index export", () => {
244
- const t = table("MDOF", [col({ name: "WORK_ID", typeName: "int" }), col({ name: "OFFER_ID", typeName: "int" })], [{ indexName: "pk_mdof", isPrimary: true, isUnique: true, columns: ["WORK_ID", "OFFER_ID"] }]);
245
- const { code } = generateSchemaCode([t], "mydb");
246
- expect(code).toContain("// Composite primary key: workId, offerId");
247
- // No inline .primaryKey() for composite keys
248
- expect(code).not.toContain(".primaryKey()");
249
- expect(code).toContain("export const mdofIndexes = [");
250
- expect(code).toContain('columns: ["WORK_ID", "OFFER_ID"], primary: true, unique: true');
251
- });
252
- it("halves national char byte length", () => {
253
- const t = table("T", [col({ name: "C", typeName: "nvarchar", length: 100, isNullable: true })]);
254
- const { code } = generateSchemaCode([t], "mydb");
255
- expect(code).toContain('nvarchar("C", { length: 50 })');
256
- expect(code).toContain(".max(50)");
257
- });
258
- it("renders numeric precision/scale", () => {
259
- const t = table("T", [col({ name: "AMT", typeName: "numeric", precision: 10, scale: 2 })]);
260
- const { code } = generateSchemaCode([t], "mydb");
261
- expect(code).toContain('numeric("AMT", { precision: 10, scale: 2 })');
262
- });
263
- it("excludes identity columns from the insert schema and marks optional fields", () => {
264
- const t = table("T", [
265
- col({ name: "ID", typeName: "int", isIdentity: true }),
266
- col({ name: "NOTE", typeName: "varchar", length: 10, isNullable: true }),
267
- col({ name: "NAME", typeName: "varchar", length: 10 })
268
- ]);
269
- const { code } = generateSchemaCode([t], "mydb");
270
- const insertBlock = code.slice(code.indexOf("InsertSchema"));
271
- expect(insertBlock).not.toContain("id:");
272
- expect(insertBlock).toContain("note: z.string().max(10).nullable().optional()");
273
- expect(insertBlock).toContain("name: z.string().max(10)");
274
- });
275
- it("warns and falls back to varchar for unmapped types", () => {
276
- const t = table("T", [col({ name: "WHEN", typeName: "date", length: 16, isNullable: true })]);
277
- const { code, warnings } = generateSchemaCode([t], "mydb");
278
- expect(code).toContain('varchar("WHEN", { length: 16 })');
279
- expect(warnings).toHaveLength(1);
280
- expect(warnings[0]).toContain('unmapped Sybase type "date"');
281
- });
282
- it("only imports the column factories that are used", () => {
283
- const t = table("T", [col({ name: "FLAG", typeName: "bit" })]);
284
- const { code } = generateSchemaCode([t], "mydb");
285
- expect(code).toContain("import { sybaseTable, bit }");
286
- expect(code).not.toContain("varchar");
287
- });
288
- it("omits precision/scale when the catalog reports null", () => {
289
- const t = table("T", [col({ name: "N", typeName: "numeric", precision: null, scale: null })]);
290
- const { code } = generateSchemaCode([t], "mydb");
291
- expect(code).toContain('numeric("N")');
292
- expect(code).not.toContain("precision: null");
293
- });
294
- it("emits precision-only when scale is null", () => {
295
- const t = table("T", [col({ name: "N", typeName: "numeric", precision: 8, scale: null })]);
296
- const { code } = generateSchemaCode([t], "mydb");
297
- expect(code).toContain('numeric("N", { precision: 8 })');
298
- });
299
- it("clamps a zero/negative catalog length to a valid width", () => {
300
- const t = table("T", [col({ name: "C", typeName: "varchar", length: 0 })]);
301
- const { code } = generateSchemaCode([t], "mydb");
302
- expect(code).toContain('varchar("C", { length: 1 })');
303
- // .max() is skipped entirely for a zero-length column
304
- expect(code).not.toContain(".max(");
305
- });
306
- it("produces valid identifiers for digit-leading table names", () => {
307
- const t = table("2024_DATA", [col({ name: "ID", typeName: "int" })]);
308
- const { code } = generateSchemaCode([t], "mydb");
309
- // Variable / type names must be valid TS identifiers (digit-prefixed -> $).
310
- expect(code).toContain('export const $2024Data = sybaseTable("2024_DATA"');
311
- expect(code).toContain("export type $2024DataRow");
312
- expect(code).toContain("export type New$2024Data");
313
- expect(code).not.toMatch(/export const 2024Data\b/);
314
- });
315
- it("escapes a reserved word used as a table name", () => {
316
- const t = table("class", [col({ name: "ID", typeName: "int" })]);
317
- const { code } = generateSchemaCode([t], "mydb");
318
- expect(code).toContain('export const $class = sybaseTable("class"');
319
- expect(code).not.toMatch(/export const class\b/);
320
- });
321
- it("quotes column field keys that are not bare identifiers", () => {
322
- const t = table("T", [
323
- col({ name: "1ST", typeName: "int" }),
324
- col({ name: "with space", typeName: "varchar", length: 5, isNullable: true })
325
- ]);
326
- const { code } = generateSchemaCode([t], "mydb");
327
- expect(code).toContain('"1st": int("1ST")');
328
- expect(code).toContain('"with space": varchar("with space", { length: 5 })');
329
- });
330
- it("does not emit a dangling comma when no extra column factories are needed", () => {
331
- const { code } = generateSchemaCode([], "mydb");
332
- expect(code).toContain('import { sybaseTable } from "drizzle-sybase";');
333
- expect(code).not.toContain("sybaseTable, }");
334
- expect(code).not.toContain("sybaseTable, }");
335
- });
336
- });
337
- describe("introspectWith", () => {
338
- it("fetches every table's columns + indexes and generates code", async () => {
339
- const db = createMockDb(sql => {
340
- if (sql.includes("sysobjects")) {
341
- return [{ name: "USERS", owner: "dbo" }];
342
- }
343
- if (sql.includes("syscomments")) {
344
- return [];
345
- }
346
- if (sql.includes("syscolumns") && sql.includes("systypes")) {
347
- return [
348
- {
349
- name: "ID",
350
- colid: 1,
351
- type_name: "INT",
352
- length: 4,
353
- prec: null,
354
- scale: null,
355
- status: 128
356
- }
357
- ];
358
- }
359
- if (sql.includes("sysindexes") && sql.includes("keycnt")) {
360
- return [{ index_name: "pk", indid: 1, status: 2 | 2048, keycnt: 1 }];
361
- }
362
- if (sql.includes("index_col")) {
363
- return [{ keyno: 1, col_name: "ID" }];
364
- }
365
- return [];
366
- });
367
- const { code, warnings } = await introspectWith(db, { database: "mydb", tables: ["USERS"] });
368
- expect(code).toContain('export const users = sybaseTable("USERS"');
369
- expect(code).toContain('id: int("ID").identity().notNull().primaryKey()');
370
- expect(warnings).toEqual([]);
371
- });
372
- });
373
- // ---------------------------------------------------------------------------
374
- // CLI argument parsing
375
- // ---------------------------------------------------------------------------
376
- describe("runCli", () => {
377
- it("prints usage and sets a non-zero exit code when required args are missing", async () => {
378
- const prevExit = process.exitCode;
379
- const errors = [];
380
- const spy = (msg) => {
381
- errors.push(String(msg));
382
- };
383
- const original = console.error;
384
- console.error = spy;
385
- try {
386
- await runCli([]);
387
- }
388
- finally {
389
- console.error = original;
390
- }
391
- expect(process.exitCode).toBe(1);
392
- expect(errors.join("\n")).toContain("Usage:");
393
- process.exitCode = prevExit;
394
- });
395
- it("rejects a non-numeric port before attempting to connect", async () => {
396
- const prevExit = process.exitCode;
397
- const errors = [];
398
- const original = console.error;
399
- console.error = ((msg) => errors.push(String(msg)));
400
- try {
401
- await runCli(["--host=h", "--port=abc", "--database=d", "--username=u", "--password=p"]);
402
- }
403
- finally {
404
- console.error = original;
405
- }
406
- expect(process.exitCode).toBe(1);
407
- expect(errors.join("\n")).toContain("Invalid port");
408
- process.exitCode = prevExit;
409
- });
410
- });
411
- //# sourceMappingURL=introspect.test.js.map