@deessejs/cli 0.3.1 → 0.3.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.
- package/dist/commands/db-generate.d.ts +5 -5
- package/dist/commands/db-generate.d.ts.map +1 -1
- package/dist/commands/db-generate.js +24 -20
- package/dist/commands/db-generate.js.map +1 -1
- package/dist/commands/db-introspect.d.ts +4 -5
- package/dist/commands/db-introspect.d.ts.map +1 -1
- package/dist/commands/db-introspect.js +17 -43
- package/dist/commands/db-introspect.js.map +1 -1
- package/dist/commands/db-migrate.d.ts +4 -5
- package/dist/commands/db-migrate.d.ts.map +1 -1
- package/dist/commands/db-migrate.js +17 -25
- package/dist/commands/db-migrate.js.map +1 -1
- package/dist/commands/db-push.d.ts +4 -5
- package/dist/commands/db-push.d.ts.map +1 -1
- package/dist/commands/db-push.js +17 -25
- package/dist/commands/db-push.js.map +1 -1
- package/dist/commands/db-studio.d.ts +3 -4
- package/dist/commands/db-studio.d.ts.map +1 -1
- package/dist/commands/db-studio.js +16 -39
- package/dist/commands/db-studio.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:generate command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for generating migrations.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* For Drizzle, run these commands:
|
|
7
|
+
* npx drizzle-kit generate
|
|
8
|
+
* npx drizzle-kit push
|
|
9
9
|
*/
|
|
10
10
|
export interface DbGenerateOptions {
|
|
11
11
|
cwd?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare function dbGenerate(
|
|
13
|
+
export declare function dbGenerate(_options?: DbGenerateOptions): Promise<void>;
|
|
14
14
|
//# sourceMappingURL=db-generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-generate.d.ts","sourceRoot":"","sources":["../../src/commands/db-generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"db-generate.d.ts","sourceRoot":"","sources":["../../src/commands/db-generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,UAAU,CAAC,QAAQ,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhF"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:generate command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for generating migrations.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* For Drizzle, run these commands:
|
|
7
|
+
* npx drizzle-kit generate
|
|
8
|
+
* npx drizzle-kit push
|
|
9
9
|
*/
|
|
10
|
-
import { execSync } from 'node:child_process';
|
|
11
10
|
import { verifySchemaPath, SCHEMA_PATH } from '../utils/schema-loader.js';
|
|
12
|
-
export async function dbGenerate(
|
|
13
|
-
const cwd = options.cwd ?? process.cwd();
|
|
11
|
+
export async function dbGenerate(_options = {}) {
|
|
14
12
|
// Verify schema file exists
|
|
15
13
|
try {
|
|
16
14
|
await verifySchemaPath();
|
|
@@ -19,18 +17,24 @@ export async function dbGenerate(options = {}) {
|
|
|
19
17
|
throw new Error(`db:generate requires ${SCHEMA_PATH} to exist.\n` +
|
|
20
18
|
`Please create this file and export your Drizzle tables.`);
|
|
21
19
|
}
|
|
22
|
-
console.warn(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
console.warn(`
|
|
21
|
+
Database Schema OK: ${SCHEMA_PATH}
|
|
22
|
+
|
|
23
|
+
To generate migrations with Drizzle, run these commands:
|
|
24
|
+
|
|
25
|
+
npx drizzle-kit generate
|
|
26
|
+
npx drizzle-kit push
|
|
27
|
+
|
|
28
|
+
Note: These commands require a drizzle.config.ts file. If you don't have one,
|
|
29
|
+
create it with:
|
|
30
|
+
|
|
31
|
+
import { defineConfig } from 'drizzle-kit';
|
|
32
|
+
|
|
33
|
+
export default defineConfig({
|
|
34
|
+
schema: './src/db/schema.ts',
|
|
35
|
+
out: './src/db/migrations',
|
|
36
|
+
dialect: 'postgresql',
|
|
37
|
+
});
|
|
38
|
+
`);
|
|
35
39
|
}
|
|
36
40
|
//# sourceMappingURL=db-generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-generate.js","sourceRoot":"","sources":["../../src/commands/db-generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"db-generate.js","sourceRoot":"","sources":["../../src/commands/db-generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAM1E,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,WAA8B,EAAE;IAC/D,4BAA4B;IAC5B,IAAI,CAAC;QACH,MAAM,gBAAgB,EAAE,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,wBAAwB,WAAW,cAAc;YACjD,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,IAAI,CAAC;sBACO,WAAW;;;;;;;;;;;;;;;;;CAiBhC,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:introspect command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for introspecting database.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Spawn drizzle-kit introspect command
|
|
6
|
+
* For Drizzle, run:
|
|
7
|
+
* npx drizzle-kit introspect
|
|
9
8
|
*/
|
|
10
9
|
export interface DbIntrospectOptions {
|
|
11
10
|
cwd?: string;
|
|
12
11
|
force?: boolean;
|
|
13
12
|
}
|
|
14
|
-
export declare function dbIntrospect(
|
|
13
|
+
export declare function dbIntrospect(_options?: DbIntrospectOptions): Promise<void>;
|
|
15
14
|
//# sourceMappingURL=db-introspect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-introspect.d.ts","sourceRoot":"","sources":["../../src/commands/db-introspect.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db-introspect.d.ts","sourceRoot":"","sources":["../../src/commands/db-introspect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,YAAY,CAAC,QAAQ,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBpF"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:introspect command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for introspecting database.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Spawn drizzle-kit introspect command
|
|
6
|
+
* For Drizzle, run:
|
|
7
|
+
* npx drizzle-kit introspect
|
|
9
8
|
*/
|
|
10
|
-
import { execSync } from 'node:child_process';
|
|
11
|
-
import { SCHEMA_PATH } from '../utils/schema-loader.js';
|
|
12
9
|
import { loadConfig } from '../utils/config.js';
|
|
13
10
|
import { detectDialect } from '../utils/dialect.js';
|
|
14
|
-
|
|
15
|
-
import * as path from 'node:path';
|
|
16
|
-
import * as p from '@clack/prompts';
|
|
17
|
-
export async function dbIntrospect(options = {}) {
|
|
18
|
-
const { cwd = process.cwd(), force = false } = options;
|
|
11
|
+
export async function dbIntrospect(_options = {}) {
|
|
19
12
|
// Load config to verify database is configured
|
|
20
13
|
const { config } = await loadConfig();
|
|
21
14
|
const db = config.database;
|
|
@@ -24,37 +17,18 @@ export async function dbIntrospect(options = {}) {
|
|
|
24
17
|
}
|
|
25
18
|
// Detect dialect
|
|
26
19
|
const dialect = detectDialect(db);
|
|
27
|
-
console.warn(`
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
// File doesn't exist, that's fine
|
|
45
|
-
}
|
|
46
|
-
console.warn('Introspecting database using drizzle-kit...');
|
|
47
|
-
try {
|
|
48
|
-
execSync('npx drizzle-kit introspect', {
|
|
49
|
-
cwd,
|
|
50
|
-
stdio: 'inherit',
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
if (error.code === 'ENOENT') {
|
|
55
|
-
throw new Error('drizzle-kit not found. Please install it: npm install drizzle-kit');
|
|
56
|
-
}
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
20
|
+
console.warn(`
|
|
21
|
+
Database Config OK
|
|
22
|
+
|
|
23
|
+
Detected dialect: ${dialect}
|
|
24
|
+
|
|
25
|
+
To introspect your database and generate a schema file, run:
|
|
26
|
+
|
|
27
|
+
npx drizzle-kit introspect
|
|
28
|
+
|
|
29
|
+
This will generate/update a schema file based on your database tables.
|
|
30
|
+
|
|
31
|
+
Note: This command requires a drizzle.config.ts file. See 'deesse db:generate' for setup.
|
|
32
|
+
`);
|
|
59
33
|
}
|
|
60
34
|
//# sourceMappingURL=db-introspect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-introspect.js","sourceRoot":"","sources":["../../src/commands/db-introspect.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db-introspect.js","sourceRoot":"","sources":["../../src/commands/db-introspect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOpD,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,WAAgC,EAAE;IACnE,+CAA+C;IAC/C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,EAAE,CAAC;IACtC,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;IAE3B,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,iBAAiB;IACjB,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAElC,OAAO,CAAC,IAAI,CAAC;;;oBAGK,OAAO;;;;;;;;;CAS1B,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:migrate command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for applying migrations.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Spawn drizzle-kit migrate command
|
|
6
|
+
* For Drizzle, run:
|
|
7
|
+
* npx drizzle-kit migrate
|
|
9
8
|
*/
|
|
10
9
|
export interface DbMigrateOptions {
|
|
11
10
|
cwd?: string;
|
|
12
11
|
dryRun?: boolean;
|
|
13
12
|
}
|
|
14
|
-
export declare function dbMigrate(
|
|
13
|
+
export declare function dbMigrate(_options?: DbMigrateOptions): Promise<void>;
|
|
15
14
|
//# sourceMappingURL=db-migrate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-migrate.d.ts","sourceRoot":"","sources":["../../src/commands/db-migrate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db-migrate.d.ts","sourceRoot":"","sources":["../../src/commands/db-migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,SAAS,CAAC,QAAQ,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB9E"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:migrate command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for applying migrations.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Spawn drizzle-kit migrate command
|
|
6
|
+
* For Drizzle, run:
|
|
7
|
+
* npx drizzle-kit migrate
|
|
9
8
|
*/
|
|
10
|
-
import { execSync } from 'node:child_process';
|
|
11
9
|
import { verifySchemaPath, SCHEMA_PATH } from '../utils/schema-loader.js';
|
|
12
|
-
export async function dbMigrate(
|
|
13
|
-
const { cwd = process.cwd(), dryRun = false } = options;
|
|
10
|
+
export async function dbMigrate(_options = {}) {
|
|
14
11
|
// Verify schema file exists
|
|
15
12
|
try {
|
|
16
13
|
await verifySchemaPath();
|
|
@@ -19,23 +16,18 @@ export async function dbMigrate(options = {}) {
|
|
|
19
16
|
throw new Error(`db:migrate requires ${SCHEMA_PATH} to exist.\n` +
|
|
20
17
|
`Please create this file and export your Drizzle tables.`);
|
|
21
18
|
}
|
|
22
|
-
console.warn(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (error.code === 'ENOENT') {
|
|
36
|
-
throw new Error('drizzle-kit not found. Please install it: npm install drizzle-kit');
|
|
37
|
-
}
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
19
|
+
console.warn(`
|
|
20
|
+
Database Schema OK: ${SCHEMA_PATH}
|
|
21
|
+
|
|
22
|
+
To apply pending migrations with Drizzle, run:
|
|
23
|
+
|
|
24
|
+
npx drizzle-kit migrate
|
|
25
|
+
|
|
26
|
+
Use --dry-run to see what would be applied:
|
|
27
|
+
|
|
28
|
+
npx drizzle-kit migrate --dry
|
|
29
|
+
|
|
30
|
+
Note: This command requires a drizzle.config.ts file. See 'deesse db:generate' for setup.
|
|
31
|
+
`);
|
|
40
32
|
}
|
|
41
33
|
//# sourceMappingURL=db-migrate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-migrate.js","sourceRoot":"","sources":["../../src/commands/db-migrate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db-migrate.js","sourceRoot":"","sources":["../../src/commands/db-migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAO1E,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,WAA6B,EAAE;IAC7D,4BAA4B;IAC5B,IAAI,CAAC;QACH,MAAM,gBAAgB,EAAE,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,uBAAuB,WAAW,cAAc;YAChD,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,IAAI,CAAC;sBACO,WAAW;;;;;;;;;;;CAWhC,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:push command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for pushing schema to database.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Spawn drizzle-kit push command
|
|
6
|
+
* For Drizzle, run:
|
|
7
|
+
* npx drizzle-kit push
|
|
9
8
|
*/
|
|
10
9
|
export interface DbPushOptions {
|
|
11
10
|
force?: boolean;
|
|
12
11
|
cwd?: string;
|
|
13
12
|
}
|
|
14
|
-
export declare function dbPush(
|
|
13
|
+
export declare function dbPush(_options?: DbPushOptions): Promise<void>;
|
|
15
14
|
//# sourceMappingURL=db-push.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-push.d.ts","sourceRoot":"","sources":["../../src/commands/db-push.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db-push.d.ts","sourceRoot":"","sources":["../../src/commands/db-push.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,MAAM,CAAC,QAAQ,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBxE"}
|
package/dist/commands/db-push.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:push command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for pushing schema to database.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Spawn drizzle-kit push command
|
|
6
|
+
* For Drizzle, run:
|
|
7
|
+
* npx drizzle-kit push
|
|
9
8
|
*/
|
|
10
|
-
import { execSync } from 'node:child_process';
|
|
11
9
|
import { verifySchemaPath, SCHEMA_PATH } from '../utils/schema-loader.js';
|
|
12
|
-
export async function dbPush(
|
|
13
|
-
const { force = false, cwd = process.cwd() } = options;
|
|
10
|
+
export async function dbPush(_options = {}) {
|
|
14
11
|
// Verify schema file exists
|
|
15
12
|
try {
|
|
16
13
|
await verifySchemaPath();
|
|
@@ -19,23 +16,18 @@ export async function dbPush(options = {}) {
|
|
|
19
16
|
throw new Error(`db:push requires ${SCHEMA_PATH} to exist.\n` +
|
|
20
17
|
`Please create this file and export your Drizzle tables.`);
|
|
21
18
|
}
|
|
22
|
-
console.warn(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (error.code === 'ENOENT') {
|
|
36
|
-
throw new Error('drizzle-kit not found. Please install it: npm install drizzle-kit');
|
|
37
|
-
}
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
19
|
+
console.warn(`
|
|
20
|
+
Database Schema OK: ${SCHEMA_PATH}
|
|
21
|
+
|
|
22
|
+
To push schema changes to your database with Drizzle, run:
|
|
23
|
+
|
|
24
|
+
npx drizzle-kit push
|
|
25
|
+
|
|
26
|
+
Use --force flag to skip confirmation:
|
|
27
|
+
|
|
28
|
+
npx drizzle-kit push --force
|
|
29
|
+
|
|
30
|
+
Note: This command requires a drizzle.config.ts file. See 'deesse db:generate' for setup.
|
|
31
|
+
`);
|
|
40
32
|
}
|
|
41
33
|
//# sourceMappingURL=db-push.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-push.js","sourceRoot":"","sources":["../../src/commands/db-push.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db-push.js","sourceRoot":"","sources":["../../src/commands/db-push.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAO1E,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,WAA0B,EAAE;IACvD,4BAA4B;IAC5B,IAAI,CAAC;QACH,MAAM,gBAAgB,EAAE,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,oBAAoB,WAAW,cAAc;YAC7C,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,IAAI,CAAC;sBACO,WAAW;;;;;;;;;;;CAWhC,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:studio command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for opening Drizzle Studio.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Spawn drizzle-kit studio command with appropriate arguments
|
|
6
|
+
* For Drizzle, run:
|
|
7
|
+
* npx drizzle-kit studio
|
|
9
8
|
*/
|
|
10
9
|
export interface DbStudioOptions {
|
|
11
10
|
port?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-studio.d.ts","sourceRoot":"","sources":["../../src/commands/db-studio.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db-studio.d.ts","sourceRoot":"","sources":["../../src/commands/db-studio.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6C3E"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* db:studio command
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Verifies schema setup and provides instructions for opening Drizzle Studio.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Spawn drizzle-kit studio command with appropriate arguments
|
|
6
|
+
* For Drizzle, run:
|
|
7
|
+
* npx drizzle-kit studio
|
|
9
8
|
*/
|
|
10
|
-
import { execSync } from 'node:child_process';
|
|
11
9
|
import { verifySchemaPath, SCHEMA_PATH } from '../utils/schema-loader.js';
|
|
12
10
|
import { detectDialect } from '../utils/dialect.js';
|
|
13
11
|
import { loadConfig } from '../utils/config.js';
|
|
14
12
|
export async function dbStudio(options = {}) {
|
|
15
|
-
const cwd = options.cwd ?? process.cwd();
|
|
16
13
|
const port = options.port ?? parseInt(process.env['DB_STUDIO_PORT'] ?? '4983', 10);
|
|
17
14
|
const host = options.host ?? process.env['DB_STUDIO_HOST'] ?? '127.0.0.1';
|
|
18
15
|
// Verify schema file exists
|
|
@@ -35,38 +32,18 @@ export async function dbStudio(options = {}) {
|
|
|
35
32
|
throw new Error(`Drizzle Studio currently only supports PostgreSQL.\n` +
|
|
36
33
|
`Detected dialect: ${dialect}`);
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
console.warn(`Since we don't use drizzle.config.ts, please either:`);
|
|
52
|
-
console.warn(`1. Create a minimal drizzle.config.ts pointing to your schema`);
|
|
53
|
-
console.warn(`2. Or use 'npx drizzle-kit studio' directly with a config file`);
|
|
54
|
-
console.warn('');
|
|
55
|
-
// Try to spawn drizzle-kit anyway - it might work if user has a config
|
|
56
|
-
try {
|
|
57
|
-
execSync(`npx ${args.join(' ')}`, {
|
|
58
|
-
cwd,
|
|
59
|
-
stdio: 'inherit',
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
if (error.code === 'ENOENT') {
|
|
64
|
-
throw new Error('drizzle-kit not found. Please install it: npm install drizzle-kit');
|
|
65
|
-
}
|
|
66
|
-
// Drizzle-kit studio might fail if no config - show helpful message
|
|
67
|
-
console.warn('Drizzle Studio requires a drizzle.config.ts file to work.');
|
|
68
|
-
console.warn('For now, please use: npx drizzle-kit studio');
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
35
|
+
console.warn(`
|
|
36
|
+
Database Schema OK: ${SCHEMA_PATH}
|
|
37
|
+
|
|
38
|
+
To open Drizzle Studio, run:
|
|
39
|
+
|
|
40
|
+
npx drizzle-kit studio
|
|
41
|
+
|
|
42
|
+
Or with custom host/port:
|
|
43
|
+
|
|
44
|
+
npx drizzle-kit studio --host ${host} --port ${port}
|
|
45
|
+
|
|
46
|
+
Note: This command requires a drizzle.config.ts file. See 'deesse db:generate' for setup.
|
|
47
|
+
`);
|
|
71
48
|
}
|
|
72
49
|
//# sourceMappingURL=db-studio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-studio.js","sourceRoot":"","sources":["../../src/commands/db-studio.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db-studio.js","sourceRoot":"","sources":["../../src/commands/db-studio.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAQhD,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,UAA2B,EAAE;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;IACnF,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,WAAW,CAAC;IAE1E,4BAA4B;IAC5B,IAAI,CAAC;QACH,MAAM,gBAAgB,EAAE,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,sBAAsB,WAAW,cAAc;YAC/C,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IAED,+CAA+C;IAC/C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,EAAE,CAAC;IACtC,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;IAE3B,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,iBAAiB;IACjB,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAElC,IAAI,OAAO,KAAK,YAAY,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,sDAAsD;YACtD,qBAAqB,OAAO,EAAE,CAC/B,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,IAAI,CAAC;sBACO,WAAW;;;;;;;;kCAQC,IAAI,WAAW,IAAI;;;CAGpD,CAAC,CAAC;AACH,CAAC"}
|