@better-auth/cli 1.3.10-beta.7 → 1.3.10

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 (2) hide show
  1. package/dist/index.mjs +21 -3
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -2290,6 +2290,11 @@ const generateDrizzleSchema = async ({
2290
2290
  sqlite: `text('${name}').array()`,
2291
2291
  pg: `text('${name}').array()`,
2292
2292
  mysql: `text('${name}').array()`
2293
+ },
2294
+ json: {
2295
+ sqlite: `text('${name}')`,
2296
+ pg: `jsonb('${name}')`,
2297
+ mysql: `json('${name}')`
2293
2298
  }
2294
2299
  };
2295
2300
  return typeMap[type][databaseType];
@@ -2366,9 +2371,15 @@ function generateImport({
2366
2371
  options
2367
2372
  }) {
2368
2373
  let imports = [];
2369
- const hasBigint = Object.values(tables).some(
2370
- (table) => Object.values(table.fields).some((field) => field.bigint)
2371
- );
2374
+ let hasBigint = false;
2375
+ let hasJson = false;
2376
+ for (const table of Object.values(tables)) {
2377
+ for (const field of Object.values(table.fields)) {
2378
+ if (field.bigint) hasBigint = true;
2379
+ if (field.type === "json") hasJson = true;
2380
+ }
2381
+ if (hasJson && hasBigint) break;
2382
+ }
2372
2383
  const useNumberId = options.advanced?.database?.useNumberId;
2373
2384
  imports.push(`${databaseType}Table`);
2374
2385
  imports.push(
@@ -2405,6 +2416,10 @@ function generateImport({
2405
2416
  imports.push("integer");
2406
2417
  }
2407
2418
  imports.push(useNumberId ? databaseType === "pg" ? "serial" : "" : "");
2419
+ if (hasJson) {
2420
+ if (databaseType === "pg") imports.push("jsonb");
2421
+ if (databaseType === "mysql") imports.push("json");
2422
+ }
2408
2423
  return `import { ${imports.map((x) => x.trim()).filter((x) => x !== "").join(", ")} } from "drizzle-orm/${databaseType}-core";
2409
2424
  `;
2410
2425
  }
@@ -2472,6 +2487,9 @@ const generatePrismaSchema = async ({
2472
2487
  if (type === "date") {
2473
2488
  return isOptional ? "DateTime?" : "DateTime";
2474
2489
  }
2490
+ if (type === "json") {
2491
+ return isOptional ? "Json?" : "Json";
2492
+ }
2475
2493
  if (type === "string[]") {
2476
2494
  return isOptional ? "String[]" : "String[]";
2477
2495
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/cli",
3
- "version": "1.3.10-beta.7",
3
+ "version": "1.3.10",
4
4
  "description": "The CLI for Better Auth",
5
5
  "module": "dist/index.mjs",
6
6
  "repository": {
@@ -54,7 +54,7 @@
54
54
  "tinyexec": "^0.3.2",
55
55
  "yocto-spinner": "^0.2.3",
56
56
  "zod": "^4.1.5",
57
- "better-auth": "1.3.10-beta.7"
57
+ "better-auth": "1.3.10"
58
58
  },
59
59
  "files": [
60
60
  "dist"