relq 1.0.1 → 1.0.2

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 (159) hide show
  1. package/dist/cjs/addon/buffer/index.cjs +1881 -0
  2. package/dist/cjs/addon/pg/index.cjs +4812 -0
  3. package/dist/cjs/addon/pg-cursor/index.cjs +1451 -0
  4. package/dist/cjs/addon/pg-format/index.cjs +2270 -0
  5. package/dist/cjs/cli/commands/add.cjs +30 -1
  6. package/dist/cjs/cli/commands/branch.cjs +141 -0
  7. package/dist/cjs/cli/commands/checkout.cjs +134 -0
  8. package/dist/cjs/cli/commands/cherry-pick.cjs +283 -0
  9. package/dist/cjs/cli/commands/diff.cjs +148 -69
  10. package/dist/cjs/cli/commands/export.cjs +64 -5
  11. package/dist/cjs/cli/commands/fetch.cjs +34 -4
  12. package/dist/cjs/cli/commands/history.cjs +1 -1
  13. package/dist/cjs/cli/commands/import.cjs +283 -12
  14. package/dist/cjs/cli/commands/log.cjs +75 -0
  15. package/dist/cjs/cli/commands/merge.cjs +224 -0
  16. package/dist/cjs/cli/commands/migrate.cjs +1 -1
  17. package/dist/cjs/cli/commands/pull.cjs +123 -7
  18. package/dist/cjs/cli/commands/push.cjs +245 -29
  19. package/dist/cjs/cli/commands/remote.cjs +16 -0
  20. package/dist/cjs/cli/commands/reset.cjs +169 -0
  21. package/dist/cjs/cli/commands/resolve.cjs +193 -0
  22. package/dist/cjs/cli/commands/rollback.cjs +1 -1
  23. package/dist/cjs/cli/commands/stash.cjs +154 -0
  24. package/dist/cjs/cli/commands/status.cjs +48 -0
  25. package/dist/cjs/cli/commands/tag.cjs +147 -0
  26. package/dist/cjs/cli/index.cjs +46 -2
  27. package/dist/cjs/cli/utils/commit-manager.cjs +3 -3
  28. package/dist/cjs/cli/utils/env-loader.cjs +3 -2
  29. package/dist/cjs/cli/utils/fast-introspect.cjs +1 -1
  30. package/dist/cjs/cli/utils/project-root.cjs +56 -0
  31. package/dist/cjs/cli/utils/relqignore.cjs +296 -38
  32. package/dist/cjs/cli/utils/repo-manager.cjs +45 -3
  33. package/dist/cjs/cli/utils/schema-introspect.cjs +2 -2
  34. package/dist/cjs/cli/utils/sql-generator.cjs +1 -1
  35. package/dist/cjs/cli/utils/sql-parser.cjs +94 -7
  36. package/dist/cjs/condition/array-condition-builder.cjs +1 -1
  37. package/dist/cjs/condition/condition-collector.cjs +1 -1
  38. package/dist/cjs/condition/fulltext-condition-builder.cjs +1 -1
  39. package/dist/cjs/condition/geometric-condition-builder.cjs +1 -1
  40. package/dist/cjs/condition/jsonb-condition-builder.cjs +1 -1
  41. package/dist/cjs/condition/network-condition-builder.cjs +1 -1
  42. package/dist/cjs/condition/range-condition-builder.cjs +1 -1
  43. package/dist/cjs/copy/copy-builder.cjs +1 -1
  44. package/dist/cjs/core/query-builder.cjs +1 -1
  45. package/dist/cjs/core/relq-client.cjs +2 -2
  46. package/dist/cjs/count/count-builder.cjs +1 -1
  47. package/dist/cjs/cte/cte-builder.cjs +1 -1
  48. package/dist/cjs/delete/delete-builder.cjs +1 -1
  49. package/dist/cjs/function/create-function-builder.cjs +1 -1
  50. package/dist/cjs/functions/advanced-functions.cjs +1 -1
  51. package/dist/cjs/functions/case-builder.cjs +1 -1
  52. package/dist/cjs/functions/geometric-functions.cjs +1 -1
  53. package/dist/cjs/functions/network-functions.cjs +1 -1
  54. package/dist/cjs/functions/sql-functions.cjs +1 -1
  55. package/dist/cjs/indexing/create-index-builder.cjs +1 -1
  56. package/dist/cjs/indexing/drop-index-builder.cjs +1 -1
  57. package/dist/cjs/insert/conflict-builder.cjs +1 -1
  58. package/dist/cjs/insert/insert-builder.cjs +1 -1
  59. package/dist/cjs/maintenance/vacuum-builder.cjs +1 -1
  60. package/dist/cjs/pubsub/listen-notify-builder.cjs +1 -1
  61. package/dist/cjs/pubsub/listener-connection.cjs +2 -2
  62. package/dist/cjs/raw/raw-query-builder.cjs +1 -1
  63. package/dist/cjs/schema/schema-builder.cjs +1 -1
  64. package/dist/cjs/schema-definition/table-definition.cjs +1 -1
  65. package/dist/cjs/select/aggregate-builder.cjs +1 -1
  66. package/dist/cjs/select/select-builder.cjs +1 -1
  67. package/dist/cjs/sequence/sequence-builder.cjs +1 -1
  68. package/dist/cjs/table/alter-table-builder.cjs +1 -1
  69. package/dist/cjs/table/constraint-builder.cjs +1 -1
  70. package/dist/cjs/table/create-table-builder.cjs +1 -1
  71. package/dist/cjs/table/partition-builder.cjs +1 -1
  72. package/dist/cjs/table/truncate-builder.cjs +1 -1
  73. package/dist/cjs/transaction/transaction-builder.cjs +1 -1
  74. package/dist/cjs/trigger/create-trigger-builder.cjs +1 -1
  75. package/dist/cjs/update/array-update-builder.cjs +1 -1
  76. package/dist/cjs/update/update-builder.cjs +1 -1
  77. package/dist/cjs/utils/index.cjs +1 -1
  78. package/dist/cjs/view/create-view-builder.cjs +1 -1
  79. package/dist/cjs/window/window-builder.cjs +1 -1
  80. package/dist/esm/cli/commands/add.js +30 -1
  81. package/dist/esm/cli/commands/branch.js +105 -0
  82. package/dist/esm/cli/commands/checkout.js +98 -0
  83. package/dist/esm/cli/commands/cherry-pick.js +247 -0
  84. package/dist/esm/cli/commands/diff.js +148 -69
  85. package/dist/esm/cli/commands/export.js +64 -5
  86. package/dist/esm/cli/commands/fetch.js +35 -5
  87. package/dist/esm/cli/commands/history.js +1 -1
  88. package/dist/esm/cli/commands/import.js +283 -12
  89. package/dist/esm/cli/commands/log.js +74 -0
  90. package/dist/esm/cli/commands/merge.js +188 -0
  91. package/dist/esm/cli/commands/migrate.js +1 -1
  92. package/dist/esm/cli/commands/pull.js +124 -8
  93. package/dist/esm/cli/commands/push.js +246 -30
  94. package/dist/esm/cli/commands/remote.js +13 -0
  95. package/dist/esm/cli/commands/reset.js +133 -0
  96. package/dist/esm/cli/commands/resolve.js +157 -0
  97. package/dist/esm/cli/commands/rollback.js +1 -1
  98. package/dist/esm/cli/commands/stash.js +118 -0
  99. package/dist/esm/cli/commands/status.js +15 -0
  100. package/dist/esm/cli/commands/tag.js +111 -0
  101. package/dist/esm/cli/index.js +47 -3
  102. package/dist/esm/cli/utils/commit-manager.js +3 -3
  103. package/dist/esm/cli/utils/env-loader.js +3 -2
  104. package/dist/esm/cli/utils/fast-introspect.js +1 -1
  105. package/dist/esm/cli/utils/project-root.js +19 -0
  106. package/dist/esm/cli/utils/relqignore.js +277 -37
  107. package/dist/esm/cli/utils/repo-manager.js +41 -3
  108. package/dist/esm/cli/utils/schema-introspect.js +2 -2
  109. package/dist/esm/cli/utils/sql-generator.js +1 -1
  110. package/dist/esm/cli/utils/sql-parser.js +94 -7
  111. package/dist/esm/condition/array-condition-builder.js +1 -1
  112. package/dist/esm/condition/condition-collector.js +1 -1
  113. package/dist/esm/condition/fulltext-condition-builder.js +1 -1
  114. package/dist/esm/condition/geometric-condition-builder.js +1 -1
  115. package/dist/esm/condition/jsonb-condition-builder.js +1 -1
  116. package/dist/esm/condition/network-condition-builder.js +1 -1
  117. package/dist/esm/condition/range-condition-builder.js +1 -1
  118. package/dist/esm/copy/copy-builder.js +1 -1
  119. package/dist/esm/core/query-builder.js +1 -1
  120. package/dist/esm/core/relq-client.js +2 -2
  121. package/dist/esm/count/count-builder.js +1 -1
  122. package/dist/esm/cte/cte-builder.js +1 -1
  123. package/dist/esm/delete/delete-builder.js +1 -1
  124. package/dist/esm/function/create-function-builder.js +1 -1
  125. package/dist/esm/functions/advanced-functions.js +1 -1
  126. package/dist/esm/functions/case-builder.js +1 -1
  127. package/dist/esm/functions/geometric-functions.js +1 -1
  128. package/dist/esm/functions/network-functions.js +1 -1
  129. package/dist/esm/functions/sql-functions.js +1 -1
  130. package/dist/esm/indexing/create-index-builder.js +1 -1
  131. package/dist/esm/indexing/drop-index-builder.js +1 -1
  132. package/dist/esm/insert/conflict-builder.js +1 -1
  133. package/dist/esm/insert/insert-builder.js +1 -1
  134. package/dist/esm/maintenance/vacuum-builder.js +1 -1
  135. package/dist/esm/pubsub/listen-notify-builder.js +1 -1
  136. package/dist/esm/pubsub/listener-connection.js +2 -2
  137. package/dist/esm/raw/raw-query-builder.js +1 -1
  138. package/dist/esm/schema/schema-builder.js +1 -1
  139. package/dist/esm/schema-definition/table-definition.js +1 -1
  140. package/dist/esm/select/aggregate-builder.js +1 -1
  141. package/dist/esm/select/select-builder.js +1 -1
  142. package/dist/esm/sequence/sequence-builder.js +1 -1
  143. package/dist/esm/table/alter-table-builder.js +1 -1
  144. package/dist/esm/table/constraint-builder.js +1 -1
  145. package/dist/esm/table/create-table-builder.js +1 -1
  146. package/dist/esm/table/partition-builder.js +1 -1
  147. package/dist/esm/table/truncate-builder.js +1 -1
  148. package/dist/esm/transaction/transaction-builder.js +1 -1
  149. package/dist/esm/trigger/create-trigger-builder.js +1 -1
  150. package/dist/esm/update/array-update-builder.js +1 -1
  151. package/dist/esm/update/update-builder.js +1 -1
  152. package/dist/esm/utils/index.js +1 -1
  153. package/dist/esm/view/create-view-builder.js +1 -1
  154. package/dist/esm/window/window-builder.js +1 -1
  155. package/package.json +1 -1
  156. /package/dist/{addons/buffer.js → esm/addon/buffer/index.js} +0 -0
  157. /package/dist/{addons/pg.js → esm/addon/pg/index.js} +0 -0
  158. /package/dist/{addons/pg-cursor.js → esm/addon/pg-cursor/index.js} +0 -0
  159. /package/dist/{addons/pg-format.js → esm/addon/pg-format/index.js} +0 -0
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.tagCommand = tagCommand;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const spinner_1 = require("../utils/spinner.cjs");
40
+ const repo_manager_1 = require("../utils/repo-manager.cjs");
41
+ function loadTags(projectRoot) {
42
+ const tagPath = path.join(projectRoot, '.relq', 'tags.json');
43
+ if (fs.existsSync(tagPath)) {
44
+ return JSON.parse(fs.readFileSync(tagPath, 'utf-8'));
45
+ }
46
+ return {};
47
+ }
48
+ function saveTags(tags, projectRoot) {
49
+ const tagPath = path.join(projectRoot, '.relq', 'tags.json');
50
+ fs.writeFileSync(tagPath, JSON.stringify(tags, null, 2));
51
+ }
52
+ async function tagCommand(context) {
53
+ const { args, flags } = context;
54
+ const projectRoot = process.cwd();
55
+ console.log('');
56
+ if (!(0, repo_manager_1.isInitialized)(projectRoot)) {
57
+ console.log(`${spinner_1.colors.red('fatal:')} not a relq repository`);
58
+ return;
59
+ }
60
+ const tags = loadTags(projectRoot);
61
+ const deleteFlag = flags['d'] === true || flags['delete'] === true;
62
+ const force = flags['f'] === true || flags['force'] === true;
63
+ if (deleteFlag) {
64
+ const tagName = args[0];
65
+ if (!tagName) {
66
+ console.log(`${spinner_1.colors.red('error:')} Please specify tag name`);
67
+ console.log('');
68
+ console.log(`Usage: ${spinner_1.colors.cyan('relq tag -d <name>')}`);
69
+ console.log('');
70
+ return;
71
+ }
72
+ if (!tags[tagName]) {
73
+ console.log(`${spinner_1.colors.red('error:')} Tag not found: ${tagName}`);
74
+ return;
75
+ }
76
+ delete tags[tagName];
77
+ saveTags(tags, projectRoot);
78
+ console.log(`${spinner_1.colors.green('✓')} Deleted tag '${tagName}'`);
79
+ console.log('');
80
+ return;
81
+ }
82
+ if (args[0]) {
83
+ const tagName = args[0];
84
+ const targetHash = args[1];
85
+ if (!/^[a-zA-Z0-9._-]+$/.test(tagName)) {
86
+ console.log(`${spinner_1.colors.red('error:')} Invalid tag name`);
87
+ console.log('Tag names can only contain: letters, numbers, dots, dashes, underscores');
88
+ console.log('');
89
+ return;
90
+ }
91
+ if (tags[tagName] && !force) {
92
+ console.log(`${spinner_1.colors.red('error:')} Tag already exists: ${tagName}`);
93
+ console.log('');
94
+ console.log(`Use ${spinner_1.colors.cyan(`relq tag -f ${tagName}`)} to overwrite`);
95
+ console.log('');
96
+ return;
97
+ }
98
+ let hash;
99
+ if (targetHash) {
100
+ const commit = (0, repo_manager_1.loadCommit)(targetHash, projectRoot);
101
+ if (!commit) {
102
+ console.log(`${spinner_1.colors.red('error:')} Commit not found: ${targetHash}`);
103
+ return;
104
+ }
105
+ hash = commit.hash;
106
+ }
107
+ else {
108
+ const head = (0, repo_manager_1.getHead)(projectRoot);
109
+ if (!head) {
110
+ console.log(`${spinner_1.colors.red('error:')} No commits yet`);
111
+ return;
112
+ }
113
+ hash = head;
114
+ }
115
+ const commit = (0, repo_manager_1.loadCommit)(hash, projectRoot);
116
+ if (!commit) {
117
+ console.log(`${spinner_1.colors.red('error:')} Cannot load commit`);
118
+ return;
119
+ }
120
+ tags[tagName] = {
121
+ hash,
122
+ message: commit.message,
123
+ createdAt: new Date().toISOString(),
124
+ };
125
+ saveTags(tags, projectRoot);
126
+ console.log(`${spinner_1.colors.green('✓')} Tagged ${spinner_1.colors.yellow((0, repo_manager_1.shortHash)(hash))} as '${spinner_1.colors.cyan(tagName)}'`);
127
+ console.log(` ${commit.message}`);
128
+ console.log('');
129
+ return;
130
+ }
131
+ const tagNames = Object.keys(tags).sort();
132
+ if (tagNames.length === 0) {
133
+ console.log(`${spinner_1.colors.muted('No tags.')}`);
134
+ console.log('');
135
+ console.log(`Create one with: ${spinner_1.colors.cyan('relq tag <name>')}`);
136
+ console.log('');
137
+ return;
138
+ }
139
+ for (const name of tagNames) {
140
+ const tag = tags[name];
141
+ const hash = spinner_1.colors.yellow((0, repo_manager_1.shortHash)(tag.hash));
142
+ const tagName = spinner_1.colors.cyan(name);
143
+ console.log(`${tagName.padEnd(20)} ${hash} ${tag.message}`);
144
+ }
145
+ console.log('');
146
+ }
147
+ exports.default = tagCommand;
@@ -49,6 +49,14 @@ const fetch_1 = require("./commands/fetch.cjs");
49
49
  const add_1 = require("./commands/add.cjs");
50
50
  const import_1 = require("./commands/import.cjs");
51
51
  const export_1 = require("./commands/export.cjs");
52
+ const resolve_1 = require("./commands/resolve.cjs");
53
+ const reset_1 = require("./commands/reset.cjs");
54
+ const stash_1 = require("./commands/stash.cjs");
55
+ const branch_1 = require("./commands/branch.cjs");
56
+ const merge_1 = require("./commands/merge.cjs");
57
+ const tag_1 = require("./commands/tag.cjs");
58
+ const cherry_pick_1 = require("./commands/cherry-pick.cjs");
59
+ const remote_1 = require("./commands/remote.cjs");
52
60
  const VERSION = '1.1.0';
53
61
  function parseArgs(argv) {
54
62
  const args = [];
@@ -179,8 +187,8 @@ async function main() {
179
187
  if (requiresConfig(command)) {
180
188
  const configPath = flags.config;
181
189
  try {
182
- const { loadConfigWithEnv, findConfigFile } = await Promise.resolve().then(() => __importStar(require("./utils/config-loader.cjs")));
183
- const foundConfig = configPath || findConfigFile();
190
+ const { loadConfigWithEnv, findConfigFileRecursive } = await Promise.resolve().then(() => __importStar(require("./utils/config-loader.cjs")));
191
+ const foundConfig = configPath ? configPath : findConfigFileRecursive()?.path;
184
192
  if (!foundConfig) {
185
193
  console.error('Error: relq.config.ts not found.');
186
194
  console.error('Run "relq init" to create one or use --config to specify a path.');
@@ -229,6 +237,9 @@ async function main() {
229
237
  case 'log':
230
238
  await (0, log_1.logCommand)(context);
231
239
  break;
240
+ case 'show':
241
+ await (0, log_1.showCommand)(context);
242
+ break;
232
243
  case 'fetch':
233
244
  await (0, fetch_1.fetchCommand)(context);
234
245
  break;
@@ -236,6 +247,39 @@ async function main() {
236
247
  case 'revert':
237
248
  await (0, rollback_1.rollbackCommand)(context);
238
249
  break;
250
+ case 'resolve':
251
+ await (0, resolve_1.resolveCommand)(context);
252
+ break;
253
+ case 'reset':
254
+ await (0, reset_1.resetCommand)(context);
255
+ break;
256
+ case 'stash':
257
+ await (0, stash_1.stashCommand)(context);
258
+ break;
259
+ case 'branch':
260
+ await (0, branch_1.branchCommand)(context);
261
+ break;
262
+ case 'checkout':
263
+ case 'switch':
264
+ console.log('');
265
+ console.log('⚠️ Branch switching is currently disabled.');
266
+ console.log('');
267
+ console.log('This feature will be available when Relq Postgres Native is officially launched.');
268
+ console.log('For now, work on a single branch and use merge to combine schemas.');
269
+ console.log('');
270
+ break;
271
+ case 'merge':
272
+ await (0, merge_1.mergeCommand)(context);
273
+ break;
274
+ case 'tag':
275
+ await (0, tag_1.tagCommand)(context);
276
+ break;
277
+ case 'cherry-pick':
278
+ await (0, cherry_pick_1.cherryPickCommand)(context);
279
+ break;
280
+ case 'remote':
281
+ await (0, remote_1.remoteCommand)(context);
282
+ break;
239
283
  case 'introspect':
240
284
  await (0, introspect_1.introspectCommand)(context);
241
285
  break;
@@ -117,7 +117,7 @@ CREATE INDEX IF NOT EXISTS idx_relq_commits_created
117
117
  ON _relq_commits(created_at DESC);
118
118
  `;
119
119
  async function ensureCommitsTable(connection) {
120
- const { Pool } = await Promise.resolve().then(() => __importStar(require("../../../addons/pg.js")));
120
+ const { Pool } = await Promise.resolve().then(() => __importStar(require("../../addon/pg/index.cjs")));
121
121
  const pool = new Pool({
122
122
  host: connection.host,
123
123
  port: connection.port || 5432,
@@ -135,7 +135,7 @@ async function ensureCommitsTable(connection) {
135
135
  }
136
136
  }
137
137
  async function getRemoteCommits(connection, limit = 100) {
138
- const { Pool } = await Promise.resolve().then(() => __importStar(require("../../../addons/pg.js")));
138
+ const { Pool } = await Promise.resolve().then(() => __importStar(require("../../addon/pg/index.cjs")));
139
139
  const pool = new Pool({
140
140
  host: connection.host,
141
141
  port: connection.port || 5432,
@@ -172,7 +172,7 @@ async function getLatestRemoteCommit(connection) {
172
172
  return commits.length > 0 ? commits[0] : null;
173
173
  }
174
174
  async function addRemoteCommit(connection, commit, limit = 1000) {
175
- const { Pool } = await Promise.resolve().then(() => __importStar(require("../../../addons/pg.js")));
175
+ const { Pool } = await Promise.resolve().then(() => __importStar(require("../../addon/pg/index.cjs")));
176
176
  const pool = new Pool({
177
177
  host: connection.host,
178
178
  port: connection.port || 5432,
@@ -4,7 +4,7 @@ exports.loadEnvConfig = loadEnvConfig;
4
4
  exports.hasEnvConfig = hasEnvConfig;
5
5
  exports.getConnectionDescription = getConnectionDescription;
6
6
  function loadEnvConfig() {
7
- const connectionString = process.env.DATABASE_CONNECTION_STRING;
7
+ const connectionString = process.env.RELQ_PG_CONN_URL || process.env.DATABASE_CONNECTION_STRING;
8
8
  if (connectionString) {
9
9
  return parseConnectionString(connectionString);
10
10
  }
@@ -42,7 +42,8 @@ function parseConnectionString(url) {
42
42
  }
43
43
  }
44
44
  function hasEnvConfig() {
45
- return !!(process.env.DATABASE_CONNECTION_STRING ||
45
+ return !!(process.env.RELQ_PG_CONN_URL ||
46
+ process.env.DATABASE_CONNECTION_STRING ||
46
47
  process.env.DATABASE_HOST);
47
48
  }
48
49
  function getConnectionDescription(config) {
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.fastIntrospectDatabase = fastIntrospectDatabase;
37
37
  async function fastIntrospectDatabase(connection, onProgress, options) {
38
38
  const { includeFunctions = false, includeTriggers = false } = options || {};
39
- const { Pool } = await Promise.resolve().then(() => __importStar(require("../../../addons/pg.js")));
39
+ const { Pool } = await Promise.resolve().then(() => __importStar(require("../../addon/pg/index.cjs")));
40
40
  onProgress?.('connecting', connection.database);
41
41
  const pool = new Pool({
42
42
  host: connection.host,
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.findProjectRoot = findProjectRoot;
37
+ exports.getRelqDir = getRelqDir;
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ function findProjectRoot(startDir = process.cwd()) {
41
+ let currentDir = path.resolve(startDir);
42
+ const root = path.parse(currentDir).root;
43
+ while (currentDir !== root) {
44
+ const packageJsonPath = path.join(currentDir, 'package.json');
45
+ if (fs.existsSync(packageJsonPath)) {
46
+ return currentDir;
47
+ }
48
+ currentDir = path.dirname(currentDir);
49
+ }
50
+ return process.cwd();
51
+ }
52
+ function getRelqDir(startDir = process.cwd()) {
53
+ const projectRoot = findProjectRoot(startDir) || process.cwd();
54
+ return path.join(projectRoot, '.relq');
55
+ }
56
+ exports.default = { findProjectRoot, getRelqDir };