drizzle-kit 0.20.4-5bb2ccb → 0.20.4-5f82cc8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/bin.cjs +37 -4
  2. package/package.json +2 -2
  3. package/utils.js +1 -1
package/bin.cjs CHANGED
@@ -19040,7 +19040,7 @@ var init_introspect_pg = __esm({
19040
19040
  const file = importsTs + decalrations;
19041
19041
  const schemaEntry = `
19042
19042
  {
19043
- ${Object.values(schema4.tables).map((it) => withCasing(it.name)).join(",")}
19043
+ ${Object.values(schema4.tables).map((it) => withCasing(it.name, casing)).join(",\n")}
19044
19044
  }
19045
19045
  `;
19046
19046
  return { file, imports: importsTs, decalrations, schemaEntry };
@@ -25861,7 +25861,7 @@ var init_introspect_sqlite = __esm({
25861
25861
  const file = importsTs + decalrations;
25862
25862
  const schemaEntry = `
25863
25863
  {
25864
- ${Object.values(schema4.tables).map((it) => withCasing2(it.name)).join(",")}
25864
+ ${Object.values(schema4.tables).map((it) => withCasing2(it.name, casing)).join(",")}
25865
25865
  }
25866
25866
  `;
25867
25867
  return { file, imports: importsTs, decalrations, schemaEntry };
@@ -58340,12 +58340,21 @@ var init_studioUtils = __esm({
58340
58340
  assertPackages("pg");
58341
58341
  const { drizzle: drizzle2 } = await import("drizzle-orm/node-postgres");
58342
58342
  const pg = await Promise.resolve().then(() => __toESM(require_lib2()));
58343
- const db = drizzle2(new pg.default.Pool(connectionConfig.dbCredentials), {
58343
+ const client = new pg.default.Pool(connectionConfig.dbCredentials);
58344
+ const db = drizzle2(client, {
58344
58345
  logger: verbose
58345
58346
  });
58347
+ const proxy = async (params) => {
58348
+ return client.query({
58349
+ text: params.sql,
58350
+ values: params.params,
58351
+ rowMode: "array"
58352
+ });
58353
+ };
58346
58354
  return {
58347
58355
  dialect: "pg",
58348
58356
  db,
58357
+ proxy,
58349
58358
  schema: pgSchema4,
58350
58359
  relations: relations4,
58351
58360
  ts
@@ -58357,9 +58366,17 @@ var init_studioUtils = __esm({
58357
58366
  const { createPool } = await Promise.resolve().then(() => __toESM(require_promise()));
58358
58367
  const client = createPool({ ...config.dbCredentials, connectionLimit: 1 });
58359
58368
  const db = drizzle2(client, { logger: verbose });
58369
+ const proxy = async (params) => {
58370
+ return client.query({
58371
+ sql: params.sql,
58372
+ values: params.params,
58373
+ rowsAsArray: true
58374
+ });
58375
+ };
58360
58376
  return {
58361
58377
  dialect: "mysql",
58362
58378
  db,
58379
+ proxy,
58363
58380
  schema: mysqlSchema4,
58364
58381
  relations: relations4,
58365
58382
  ts
@@ -58373,9 +58390,13 @@ var init_studioUtils = __esm({
58373
58390
  const db = drizzle2(execute2, creds.wranglerConfigPath, creds.dbName, {
58374
58391
  logger: verbose
58375
58392
  });
58393
+ const proxy = async (params) => {
58394
+ throw new Error("Proxy is not implemented for D1");
58395
+ };
58376
58396
  return {
58377
58397
  dialect: "sqlite",
58378
58398
  db,
58399
+ proxy,
58379
58400
  schema: sqliteSchema2,
58380
58401
  relations: relations4,
58381
58402
  ts
@@ -58387,9 +58408,14 @@ var init_studioUtils = __esm({
58387
58408
  const Database = await import("better-sqlite3");
58388
58409
  const client = new Database.default(creds.url);
58389
58410
  const db = drizzle2(client, { logger: verbose });
58411
+ const proxy = async (params) => {
58412
+ const sql2 = params.sql;
58413
+ return client.prepare(sql2).all(params.params);
58414
+ };
58390
58415
  return {
58391
58416
  dialect: "sqlite",
58392
58417
  db,
58418
+ proxy,
58393
58419
  schema: sqliteSchema2,
58394
58420
  relations: relations4,
58395
58421
  ts
@@ -58404,9 +58430,16 @@ var init_studioUtils = __esm({
58404
58430
  client,
58405
58431
  { logger: verbose }
58406
58432
  );
58433
+ const proxy = async (params) => {
58434
+ return client.execute({
58435
+ sql: params.sql,
58436
+ args: params.params
58437
+ });
58438
+ };
58407
58439
  return {
58408
58440
  dialect: "sqlite",
58409
58441
  db,
58442
+ proxy,
58410
58443
  schema: sqliteSchema2,
58411
58444
  relations: relations4,
58412
58445
  ts
@@ -60243,7 +60276,7 @@ var package_default = {
60243
60276
  ]
60244
60277
  },
60245
60278
  dependencies: {
60246
- "@drizzle-team/studio": "^0.0.31",
60279
+ "@drizzle-team/studio": "^0.0.32",
60247
60280
  "@esbuild-kit/esm-loader": "^2.5.5",
60248
60281
  camelcase: "^7.0.1",
60249
60282
  chalk: "^5.2.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.20.4-5bb2ccb",
3
+ "version": "0.20.4-5f82cc8",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -56,7 +56,7 @@
56
56
  ]
57
57
  },
58
58
  "dependencies": {
59
- "@drizzle-team/studio": "^0.0.31",
59
+ "@drizzle-team/studio": "^0.0.32",
60
60
  "@esbuild-kit/esm-loader": "^2.5.5",
61
61
  "camelcase": "^7.0.1",
62
62
  "chalk": "^5.2.0",
package/utils.js CHANGED
@@ -18014,7 +18014,7 @@ var init_introspect_pg = __esm({
18014
18014
  const file = importsTs + decalrations;
18015
18015
  const schemaEntry = `
18016
18016
  {
18017
- ${Object.values(schema4.tables).map((it) => withCasing(it.name)).join(",")}
18017
+ ${Object.values(schema4.tables).map((it) => withCasing(it.name, casing)).join(",\n")}
18018
18018
  }
18019
18019
  `;
18020
18020
  return { file, imports: importsTs, decalrations, schemaEntry };