@ductape/cli 0.2.11 → 0.2.13

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.
@@ -5,6 +5,7 @@ interface SchemaGenerateOpts {
5
5
  export declare function runDbSchemaGenerate(opts: SchemaGenerateOpts): Promise<void>;
6
6
  interface SchemaPushOpts {
7
7
  db: string;
8
+ env: string;
8
9
  }
9
10
  export declare function runDbSchemaPush(opts: SchemaPushOpts): Promise<void>;
10
11
  export {};
@@ -353,7 +353,7 @@ function adaptColumn(col) {
353
353
  export async function runDbSchemaPush(opts) {
354
354
  const session = requireSession();
355
355
  const proxy = getDbProxy(session);
356
- const envSlug = session.project.env_slug;
356
+ const envSlug = opts.env;
357
357
  const productTag = session.project.product_tag;
358
358
  const dbContext = { database: opts.db, env: envSlug, product: productTag };
359
359
  console.log(`Connecting to database "${opts.db}" (env: ${envSlug})...`);
@@ -403,6 +403,7 @@ export async function runDbSchemaPush(opts) {
403
403
  workspace_id: session.project.workspace_id,
404
404
  product_tag: productTag,
405
405
  database_tag: opts.db,
406
+ env_slug: envSlug,
406
407
  table_schemas: tableSchemas,
407
408
  });
408
409
  console.log(`Done. Synced ${result.synced} table(s): ${result.tables.join(', ')}`);
package/dist/index.js CHANGED
@@ -309,7 +309,8 @@ dbSchema
309
309
  .command('push')
310
310
  .description('Read live table schema from the database and sync it to the Ductape server (enables AI field guidance)')
311
311
  .requiredOption('--db <tag>', 'Database tag to sync')
312
- .action(wrap((opts) => runDbSchemaPush({ db: opts.db })));
312
+ .requiredOption('--env <slug>', 'Environment slug (e.g. snd, prd) whose live database to read from')
313
+ .action(wrap((opts) => runDbSchemaPush({ db: opts.db, env: opts.env })));
313
314
  db
314
315
  .argument('[verb]', 'connect | query | …')
315
316
  .option('-f, --file <path>')
@@ -36,6 +36,7 @@ export declare function pushDatabaseSchema(apiUrl: string, creds: Credentials, o
36
36
  workspace_id: string;
37
37
  product_tag: string;
38
38
  database_tag: string;
39
+ env_slug: string;
39
40
  table_schemas: TableSchemaRecord[];
40
41
  }): Promise<{
41
42
  synced: number;
@@ -31,6 +31,7 @@ export async function pushDatabaseSchema(apiUrl, creds, opts) {
31
31
  workspace_id: opts.workspace_id,
32
32
  product_tag: opts.product_tag,
33
33
  database_tag: opts.database_tag,
34
+ env_slug: opts.env_slug,
34
35
  table_schemas: opts.table_schemas,
35
36
  }),
36
37
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/cli",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "description": "Ductape CLI — local platform, login, link projects, and manage resources via the proxy (Workbench-compatible)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -340,6 +340,7 @@ function requireSilent(): ReturnType<typeof requireSession> | null {
340
340
 
341
341
  interface SchemaPushOpts {
342
342
  db: string;
343
+ env: string;
343
344
  }
344
345
 
345
346
  function adaptColumn(col: Record<string, unknown>): TableColumnRecord {
@@ -357,7 +358,7 @@ function adaptColumn(col: Record<string, unknown>): TableColumnRecord {
357
358
  export async function runDbSchemaPush(opts: SchemaPushOpts): Promise<void> {
358
359
  const session = requireSession();
359
360
  const proxy = getDbProxy(session);
360
- const envSlug = session.project.env_slug;
361
+ const envSlug = opts.env;
361
362
  const productTag = session.project.product_tag;
362
363
  const dbContext = { database: opts.db, env: envSlug, product: productTag };
363
364
 
@@ -419,6 +420,7 @@ export async function runDbSchemaPush(opts: SchemaPushOpts): Promise<void> {
419
420
  workspace_id: session.project.workspace_id,
420
421
  product_tag: productTag,
421
422
  database_tag: opts.db,
423
+ env_slug: envSlug,
422
424
  table_schemas: tableSchemas,
423
425
  });
424
426
 
package/src/index.ts CHANGED
@@ -402,7 +402,8 @@ dbSchema
402
402
  .command('push')
403
403
  .description('Read live table schema from the database and sync it to the Ductape server (enables AI field guidance)')
404
404
  .requiredOption('--db <tag>', 'Database tag to sync')
405
- .action(wrap((opts) => runDbSchemaPush({ db: opts.db })));
405
+ .requiredOption('--env <slug>', 'Environment slug (e.g. snd, prd) whose live database to read from')
406
+ .action(wrap((opts) => runDbSchemaPush({ db: opts.db, env: opts.env })));
406
407
 
407
408
  db
408
409
  .argument('[verb]', 'connect | query | …')
@@ -69,6 +69,7 @@ export async function pushDatabaseSchema(
69
69
  workspace_id: string;
70
70
  product_tag: string;
71
71
  database_tag: string;
72
+ env_slug: string;
72
73
  table_schemas: TableSchemaRecord[];
73
74
  },
74
75
  ): Promise<{ synced: number; tables: string[] }> {
@@ -84,6 +85,7 @@ export async function pushDatabaseSchema(
84
85
  workspace_id: opts.workspace_id,
85
86
  product_tag: opts.product_tag,
86
87
  database_tag: opts.database_tag,
88
+ env_slug: opts.env_slug,
87
89
  table_schemas: opts.table_schemas,
88
90
  }),
89
91
  });