@hienlh/ppm 0.12.4 → 0.12.5
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/CHANGELOG.md +5 -0
- package/bun.lock +2062 -0
- package/bunfig.toml +2 -0
- package/package.json +1 -1
- package/src/cli/commands/db-cmd.ts +5 -0
- package/src/index.ts +0 -0
package/bunfig.toml
ADDED
package/package.json
CHANGED
|
@@ -168,6 +168,7 @@ export function registerDbCommands(program: Command): void {
|
|
|
168
168
|
if (conn.type === "postgres") {
|
|
169
169
|
const { postgresService } = await import("../../services/postgres.service.ts");
|
|
170
170
|
const result = await postgresService.testConnection(cfg.connectionString!);
|
|
171
|
+
await postgresService.closeAll();
|
|
171
172
|
if (result.ok) {
|
|
172
173
|
console.log(`${C.green}✓${C.reset} Connection successful: ${conn.name}`);
|
|
173
174
|
} else {
|
|
@@ -208,6 +209,7 @@ export function registerDbCommands(program: Command): void {
|
|
|
208
209
|
if (conn.type === "postgres") {
|
|
209
210
|
const { postgresService } = await import("../../services/postgres.service.ts");
|
|
210
211
|
const tables = await postgresService.getTables(cfg.connectionString!);
|
|
212
|
+
await postgresService.closeAll();
|
|
211
213
|
if (tables.length === 0) {
|
|
212
214
|
console.log(`${C.dim}No tables found.${C.reset}`);
|
|
213
215
|
return;
|
|
@@ -251,6 +253,7 @@ export function registerDbCommands(program: Command): void {
|
|
|
251
253
|
if (conn.type === "postgres") {
|
|
252
254
|
const { postgresService } = await import("../../services/postgres.service.ts");
|
|
253
255
|
const cols = await postgresService.getTableSchema(cfg.connectionString!, table, options.schema);
|
|
256
|
+
await postgresService.closeAll();
|
|
254
257
|
printTable(
|
|
255
258
|
["Column", "Type", "Nullable", "PK", "Default"],
|
|
256
259
|
cols.map((c) => [c.name, c.type, c.nullable ? "YES" : "NO", c.pk ? "PK" : "", c.defaultValue ?? ""]),
|
|
@@ -295,6 +298,7 @@ export function registerDbCommands(program: Command): void {
|
|
|
295
298
|
const result = await postgresService.getTableData(
|
|
296
299
|
cfg.connectionString!, table, options.schema, page, limit, options.order, orderDir,
|
|
297
300
|
);
|
|
301
|
+
await postgresService.closeAll();
|
|
298
302
|
console.log(`${C.cyan}${table}${C.reset} — page ${result.page}, ${result.total} total rows\n`);
|
|
299
303
|
formatRows(result.columns, result.rows, limit);
|
|
300
304
|
} else {
|
|
@@ -334,6 +338,7 @@ export function registerDbCommands(program: Command): void {
|
|
|
334
338
|
if (conn.type === "postgres") {
|
|
335
339
|
const { postgresService } = await import("../../services/postgres.service.ts");
|
|
336
340
|
const result = await postgresService.executeQuery(cfg.connectionString!, sql);
|
|
341
|
+
await postgresService.closeAll();
|
|
337
342
|
if (result.changeType === "select") {
|
|
338
343
|
formatRows(result.columns, result.rows);
|
|
339
344
|
} else {
|
package/src/index.ts
CHANGED
|
File without changes
|