drizzle-kit 1.0.0-beta.13-4ef3fca → 1.0.0-beta.14-89db290

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/api-mysql.d.mts CHANGED
@@ -1,24 +1,24 @@
1
1
  import { t as CasingType } from "./common-Bc72_W-g.mjs";
2
- import * as zod3716 from "zod";
2
+ import * as zod0 from "zod";
3
3
  import { TypeOf } from "zod";
4
4
 
5
5
  //#region src/cli/validations/mysql.d.ts
6
- declare const mysqlCredentials: zod3716.ZodUnion<[zod3716.ZodObject<{
7
- host: zod3716.ZodString;
8
- port: zod3716.ZodOptional<zod3716.ZodNumber>;
9
- user: zod3716.ZodOptional<zod3716.ZodString>;
10
- password: zod3716.ZodOptional<zod3716.ZodString>;
11
- database: zod3716.ZodString;
12
- ssl: zod3716.ZodOptional<zod3716.ZodUnion<[zod3716.ZodString, zod3716.ZodObject<{
13
- pfx: zod3716.ZodOptional<zod3716.ZodString>;
14
- key: zod3716.ZodOptional<zod3716.ZodString>;
15
- passphrase: zod3716.ZodOptional<zod3716.ZodString>;
16
- cert: zod3716.ZodOptional<zod3716.ZodString>;
17
- ca: zod3716.ZodOptional<zod3716.ZodUnion<[zod3716.ZodString, zod3716.ZodArray<zod3716.ZodString, "many">]>>;
18
- crl: zod3716.ZodOptional<zod3716.ZodUnion<[zod3716.ZodString, zod3716.ZodArray<zod3716.ZodString, "many">]>>;
19
- ciphers: zod3716.ZodOptional<zod3716.ZodString>;
20
- rejectUnauthorized: zod3716.ZodOptional<zod3716.ZodBoolean>;
21
- }, "strip", zod3716.ZodTypeAny, {
6
+ declare const mysqlCredentials: zod0.ZodUnion<[zod0.ZodObject<{
7
+ host: zod0.ZodString;
8
+ port: zod0.ZodOptional<zod0.ZodNumber>;
9
+ user: zod0.ZodOptional<zod0.ZodString>;
10
+ password: zod0.ZodOptional<zod0.ZodString>;
11
+ database: zod0.ZodString;
12
+ ssl: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodString, zod0.ZodObject<{
13
+ pfx: zod0.ZodOptional<zod0.ZodString>;
14
+ key: zod0.ZodOptional<zod0.ZodString>;
15
+ passphrase: zod0.ZodOptional<zod0.ZodString>;
16
+ cert: zod0.ZodOptional<zod0.ZodString>;
17
+ ca: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodString, zod0.ZodArray<zod0.ZodString, "many">]>>;
18
+ crl: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodString, zod0.ZodArray<zod0.ZodString, "many">]>>;
19
+ ciphers: zod0.ZodOptional<zod0.ZodString>;
20
+ rejectUnauthorized: zod0.ZodOptional<zod0.ZodBoolean>;
21
+ }, "strip", zod0.ZodTypeAny, {
22
22
  pfx?: string | undefined;
23
23
  key?: string | undefined;
24
24
  passphrase?: string | undefined;
@@ -37,7 +37,7 @@ declare const mysqlCredentials: zod3716.ZodUnion<[zod3716.ZodObject<{
37
37
  ciphers?: string | undefined;
38
38
  rejectUnauthorized?: boolean | undefined;
39
39
  }>]>>;
40
- }, "strip", zod3716.ZodTypeAny, {
40
+ }, "strip", zod0.ZodTypeAny, {
41
41
  host: string;
42
42
  database: string;
43
43
  port?: number | undefined;
@@ -69,9 +69,9 @@ declare const mysqlCredentials: zod3716.ZodUnion<[zod3716.ZodObject<{
69
69
  ciphers?: string | undefined;
70
70
  rejectUnauthorized?: boolean | undefined;
71
71
  } | undefined;
72
- }>, zod3716.ZodObject<{
73
- url: zod3716.ZodString;
74
- }, "strip", zod3716.ZodTypeAny, {
72
+ }>, zod0.ZodObject<{
73
+ url: zod0.ZodString;
74
+ }, "strip", zod0.ZodTypeAny, {
75
75
  url: string;
76
76
  }, {
77
77
  url: string;
package/api-mysql.js CHANGED
@@ -5,7 +5,7 @@ const startStudioServer = async (imports, credentials, options) => {
5
5
  const { is } = require("drizzle-orm");
6
6
  const { MySqlTable, getTableConfig } = require("drizzle-orm/mysql-core");
7
7
  const { Relations } = require("drizzle-orm/_relations");
8
- const { drizzleForMySQL, prepareServer } = await Promise.resolve().then(() => require("./studio-e9LPrWEG.js"));
8
+ const { drizzleForMySQL, prepareServer } = await Promise.resolve().then(() => require("./studio-CbNHJGpE.js"));
9
9
  const mysqlSchema = {};
10
10
  const relations = {};
11
11
  Object.entries(imports).forEach(([k, t]) => {
package/api-mysql.mjs CHANGED
@@ -9371,7 +9371,7 @@ var init_grammar$4 = __esmMin((() => {
9371
9371
  default: ""
9372
9372
  };
9373
9373
  const trimmed = trimChar(def, "'");
9374
- if (trimmed.includes("now(") || trimmed.includes("CURRENT_TIMESTAMP(")) return {
9374
+ if (trimmed.includes("now") || trimmed.includes("CURRENT_TIMESTAMP")) return {
9375
9375
  options,
9376
9376
  default: `sql\`${trimmed}\``
9377
9377
  };
@@ -1,20 +1,20 @@
1
1
  import { t as CasingType } from "./common-Bc72_W-g.mjs";
2
- import * as zod3308 from "zod";
2
+ import * as zod3349 from "zod";
3
3
  import { TypeOf } from "zod";
4
4
  import { PGlite } from "@electric-sql/pglite";
5
5
  import { PgAsyncDatabase } from "drizzle-orm/pg-core/async";
6
6
 
7
7
  //#region src/cli/validations/cli.d.ts
8
8
  declare const entitiesParams: {
9
- tablesFilter: zod3308.ZodOptional<zod3308.ZodUnion<[zod3308.ZodString, zod3308.ZodArray<zod3308.ZodString, "many">]>>;
10
- schemaFilter: zod3308.ZodOptional<zod3308.ZodUnion<[zod3308.ZodString, zod3308.ZodArray<zod3308.ZodString, "many">]>>;
11
- extensionsFilters: zod3308.ZodOptional<zod3308.ZodArray<zod3308.ZodLiteral<"postgis">, "many">>;
12
- entities: zod3308.ZodOptional<zod3308.ZodObject<{
13
- roles: zod3308.ZodDefault<zod3308.ZodOptional<zod3308.ZodUnion<[zod3308.ZodBoolean, zod3308.ZodObject<{
14
- provider: zod3308.ZodOptional<zod3308.ZodString>;
15
- include: zod3308.ZodOptional<zod3308.ZodArray<zod3308.ZodString, "many">>;
16
- exclude: zod3308.ZodOptional<zod3308.ZodArray<zod3308.ZodString, "many">>;
17
- }, "strip", zod3308.ZodTypeAny, {
9
+ tablesFilter: zod3349.ZodOptional<zod3349.ZodUnion<[zod3349.ZodString, zod3349.ZodArray<zod3349.ZodString, "many">]>>;
10
+ schemaFilter: zod3349.ZodOptional<zod3349.ZodUnion<[zod3349.ZodString, zod3349.ZodArray<zod3349.ZodString, "many">]>>;
11
+ extensionsFilters: zod3349.ZodOptional<zod3349.ZodArray<zod3349.ZodLiteral<"postgis">, "many">>;
12
+ entities: zod3349.ZodOptional<zod3349.ZodObject<{
13
+ roles: zod3349.ZodDefault<zod3349.ZodOptional<zod3349.ZodUnion<[zod3349.ZodBoolean, zod3349.ZodObject<{
14
+ provider: zod3349.ZodOptional<zod3349.ZodString>;
15
+ include: zod3349.ZodOptional<zod3349.ZodArray<zod3349.ZodString, "many">>;
16
+ exclude: zod3349.ZodOptional<zod3349.ZodArray<zod3349.ZodString, "many">>;
17
+ }, "strip", zod3349.ZodTypeAny, {
18
18
  provider?: string | undefined;
19
19
  include?: string[] | undefined;
20
20
  exclude?: string[] | undefined;
@@ -23,7 +23,7 @@ declare const entitiesParams: {
23
23
  include?: string[] | undefined;
24
24
  exclude?: string[] | undefined;
25
25
  }>]>>>;
26
- }, "strip", zod3308.ZodTypeAny, {
26
+ }, "strip", zod3349.ZodTypeAny, {
27
27
  roles: boolean | {
28
28
  provider?: string | undefined;
29
29
  include?: string[] | undefined;
@@ -49,21 +49,21 @@ type EntitiesFilterConfig = {
49
49
  };
50
50
  //#endregion
51
51
  //#region src/cli/validations/postgres.d.ts
52
- declare const postgresCredentials: zod3308.ZodUnion<[zod3308.ZodEffects<zod3308.ZodObject<{
53
- driver: zod3308.ZodUndefined;
54
- host: zod3308.ZodString;
55
- port: zod3308.ZodOptional<zod3308.ZodNumber>;
56
- user: zod3308.ZodOptional<zod3308.ZodString>;
57
- password: zod3308.ZodOptional<zod3308.ZodString>;
58
- database: zod3308.ZodString;
59
- ssl: zod3308.ZodOptional<zod3308.ZodUnion<[zod3308.ZodLiteral<"require">, zod3308.ZodLiteral<"allow">, zod3308.ZodLiteral<"prefer">, zod3308.ZodLiteral<"verify-full">, zod3308.ZodBoolean, zod3308.ZodObject<{}, "passthrough", zod3308.ZodTypeAny, zod3308.objectOutputType<{}, zod3308.ZodTypeAny, "passthrough">, zod3308.objectInputType<{}, zod3308.ZodTypeAny, "passthrough">>]>>;
60
- }, "strip", zod3308.ZodTypeAny, {
52
+ declare const postgresCredentials: zod3349.ZodUnion<[zod3349.ZodEffects<zod3349.ZodObject<{
53
+ driver: zod3349.ZodUndefined;
54
+ host: zod3349.ZodString;
55
+ port: zod3349.ZodOptional<zod3349.ZodNumber>;
56
+ user: zod3349.ZodOptional<zod3349.ZodString>;
57
+ password: zod3349.ZodOptional<zod3349.ZodString>;
58
+ database: zod3349.ZodString;
59
+ ssl: zod3349.ZodOptional<zod3349.ZodUnion<[zod3349.ZodLiteral<"require">, zod3349.ZodLiteral<"allow">, zod3349.ZodLiteral<"prefer">, zod3349.ZodLiteral<"verify-full">, zod3349.ZodBoolean, zod3349.ZodObject<{}, "passthrough", zod3349.ZodTypeAny, zod3349.objectOutputType<{}, zod3349.ZodTypeAny, "passthrough">, zod3349.objectInputType<{}, zod3349.ZodTypeAny, "passthrough">>]>>;
60
+ }, "strip", zod3349.ZodTypeAny, {
61
61
  host: string;
62
62
  database: string;
63
63
  port?: number | undefined;
64
64
  user?: string | undefined;
65
65
  password?: string | undefined;
66
- ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3308.objectOutputType<{}, zod3308.ZodTypeAny, "passthrough"> | undefined;
66
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3349.objectOutputType<{}, zod3349.ZodTypeAny, "passthrough"> | undefined;
67
67
  driver?: undefined;
68
68
  }, {
69
69
  host: string;
@@ -71,7 +71,7 @@ declare const postgresCredentials: zod3308.ZodUnion<[zod3308.ZodEffects<zod3308.
71
71
  port?: number | undefined;
72
72
  user?: string | undefined;
73
73
  password?: string | undefined;
74
- ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3308.objectInputType<{}, zod3308.ZodTypeAny, "passthrough"> | undefined;
74
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3349.objectInputType<{}, zod3349.ZodTypeAny, "passthrough"> | undefined;
75
75
  driver?: undefined;
76
76
  }>, Omit<{
77
77
  host: string;
@@ -79,7 +79,7 @@ declare const postgresCredentials: zod3308.ZodUnion<[zod3308.ZodEffects<zod3308.
79
79
  port?: number | undefined;
80
80
  user?: string | undefined;
81
81
  password?: string | undefined;
82
- ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3308.objectOutputType<{}, zod3308.ZodTypeAny, "passthrough"> | undefined;
82
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3349.objectOutputType<{}, zod3349.ZodTypeAny, "passthrough"> | undefined;
83
83
  driver?: undefined;
84
84
  }, "driver">, {
85
85
  host: string;
@@ -87,12 +87,12 @@ declare const postgresCredentials: zod3308.ZodUnion<[zod3308.ZodEffects<zod3308.
87
87
  port?: number | undefined;
88
88
  user?: string | undefined;
89
89
  password?: string | undefined;
90
- ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3308.objectInputType<{}, zod3308.ZodTypeAny, "passthrough"> | undefined;
90
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3349.objectInputType<{}, zod3349.ZodTypeAny, "passthrough"> | undefined;
91
91
  driver?: undefined;
92
- }>, zod3308.ZodEffects<zod3308.ZodObject<{
93
- driver: zod3308.ZodUndefined;
94
- url: zod3308.ZodString;
95
- }, "strip", zod3308.ZodTypeAny, {
92
+ }>, zod3349.ZodEffects<zod3349.ZodObject<{
93
+ driver: zod3349.ZodUndefined;
94
+ url: zod3349.ZodString;
95
+ }, "strip", zod3349.ZodTypeAny, {
96
96
  url: string;
97
97
  driver?: undefined;
98
98
  }, {
@@ -103,12 +103,12 @@ declare const postgresCredentials: zod3308.ZodUnion<[zod3308.ZodEffects<zod3308.
103
103
  }, {
104
104
  url: string;
105
105
  driver?: undefined;
106
- }>, zod3308.ZodObject<{
107
- driver: zod3308.ZodLiteral<"aws-data-api">;
108
- database: zod3308.ZodString;
109
- secretArn: zod3308.ZodString;
110
- resourceArn: zod3308.ZodString;
111
- }, "strip", zod3308.ZodTypeAny, {
106
+ }>, zod3349.ZodObject<{
107
+ driver: zod3349.ZodLiteral<"aws-data-api">;
108
+ database: zod3349.ZodString;
109
+ secretArn: zod3349.ZodString;
110
+ resourceArn: zod3349.ZodString;
111
+ }, "strip", zod3349.ZodTypeAny, {
112
112
  database: string;
113
113
  driver: "aws-data-api";
114
114
  secretArn: string;
@@ -118,10 +118,10 @@ declare const postgresCredentials: zod3308.ZodUnion<[zod3308.ZodEffects<zod3308.
118
118
  driver: "aws-data-api";
119
119
  secretArn: string;
120
120
  resourceArn: string;
121
- }>, zod3308.ZodObject<{
122
- driver: zod3308.ZodLiteral<"pglite">;
123
- url: zod3308.ZodString;
124
- }, "strip", zod3308.ZodTypeAny, {
121
+ }>, zod3349.ZodObject<{
122
+ driver: zod3349.ZodLiteral<"pglite">;
123
+ url: zod3349.ZodString;
124
+ }, "strip", zod3349.ZodTypeAny, {
125
125
  url: string;
126
126
  driver: "pglite";
127
127
  }, {
package/api-postgres.d.ts CHANGED
@@ -1,20 +1,20 @@
1
1
  import { t as CasingType } from "./common-C4PhmYTg.js";
2
- import * as zod3349 from "zod";
2
+ import * as zod3327 from "zod";
3
3
  import { TypeOf } from "zod";
4
4
  import { PGlite } from "@electric-sql/pglite";
5
5
  import { PgAsyncDatabase } from "drizzle-orm/pg-core/async";
6
6
 
7
7
  //#region src/cli/validations/cli.d.ts
8
8
  declare const entitiesParams: {
9
- tablesFilter: zod3349.ZodOptional<zod3349.ZodUnion<[zod3349.ZodString, zod3349.ZodArray<zod3349.ZodString, "many">]>>;
10
- schemaFilter: zod3349.ZodOptional<zod3349.ZodUnion<[zod3349.ZodString, zod3349.ZodArray<zod3349.ZodString, "many">]>>;
11
- extensionsFilters: zod3349.ZodOptional<zod3349.ZodArray<zod3349.ZodLiteral<"postgis">, "many">>;
12
- entities: zod3349.ZodOptional<zod3349.ZodObject<{
13
- roles: zod3349.ZodDefault<zod3349.ZodOptional<zod3349.ZodUnion<[zod3349.ZodBoolean, zod3349.ZodObject<{
14
- provider: zod3349.ZodOptional<zod3349.ZodString>;
15
- include: zod3349.ZodOptional<zod3349.ZodArray<zod3349.ZodString, "many">>;
16
- exclude: zod3349.ZodOptional<zod3349.ZodArray<zod3349.ZodString, "many">>;
17
- }, "strip", zod3349.ZodTypeAny, {
9
+ tablesFilter: zod3327.ZodOptional<zod3327.ZodUnion<[zod3327.ZodString, zod3327.ZodArray<zod3327.ZodString, "many">]>>;
10
+ schemaFilter: zod3327.ZodOptional<zod3327.ZodUnion<[zod3327.ZodString, zod3327.ZodArray<zod3327.ZodString, "many">]>>;
11
+ extensionsFilters: zod3327.ZodOptional<zod3327.ZodArray<zod3327.ZodLiteral<"postgis">, "many">>;
12
+ entities: zod3327.ZodOptional<zod3327.ZodObject<{
13
+ roles: zod3327.ZodDefault<zod3327.ZodOptional<zod3327.ZodUnion<[zod3327.ZodBoolean, zod3327.ZodObject<{
14
+ provider: zod3327.ZodOptional<zod3327.ZodString>;
15
+ include: zod3327.ZodOptional<zod3327.ZodArray<zod3327.ZodString, "many">>;
16
+ exclude: zod3327.ZodOptional<zod3327.ZodArray<zod3327.ZodString, "many">>;
17
+ }, "strip", zod3327.ZodTypeAny, {
18
18
  provider?: string | undefined;
19
19
  include?: string[] | undefined;
20
20
  exclude?: string[] | undefined;
@@ -23,7 +23,7 @@ declare const entitiesParams: {
23
23
  include?: string[] | undefined;
24
24
  exclude?: string[] | undefined;
25
25
  }>]>>>;
26
- }, "strip", zod3349.ZodTypeAny, {
26
+ }, "strip", zod3327.ZodTypeAny, {
27
27
  roles: boolean | {
28
28
  provider?: string | undefined;
29
29
  include?: string[] | undefined;
@@ -49,21 +49,21 @@ type EntitiesFilterConfig = {
49
49
  };
50
50
  //#endregion
51
51
  //#region src/cli/validations/postgres.d.ts
52
- declare const postgresCredentials: zod3349.ZodUnion<[zod3349.ZodEffects<zod3349.ZodObject<{
53
- driver: zod3349.ZodUndefined;
54
- host: zod3349.ZodString;
55
- port: zod3349.ZodOptional<zod3349.ZodNumber>;
56
- user: zod3349.ZodOptional<zod3349.ZodString>;
57
- password: zod3349.ZodOptional<zod3349.ZodString>;
58
- database: zod3349.ZodString;
59
- ssl: zod3349.ZodOptional<zod3349.ZodUnion<[zod3349.ZodLiteral<"require">, zod3349.ZodLiteral<"allow">, zod3349.ZodLiteral<"prefer">, zod3349.ZodLiteral<"verify-full">, zod3349.ZodBoolean, zod3349.ZodObject<{}, "passthrough", zod3349.ZodTypeAny, zod3349.objectOutputType<{}, zod3349.ZodTypeAny, "passthrough">, zod3349.objectInputType<{}, zod3349.ZodTypeAny, "passthrough">>]>>;
60
- }, "strip", zod3349.ZodTypeAny, {
52
+ declare const postgresCredentials: zod3327.ZodUnion<[zod3327.ZodEffects<zod3327.ZodObject<{
53
+ driver: zod3327.ZodUndefined;
54
+ host: zod3327.ZodString;
55
+ port: zod3327.ZodOptional<zod3327.ZodNumber>;
56
+ user: zod3327.ZodOptional<zod3327.ZodString>;
57
+ password: zod3327.ZodOptional<zod3327.ZodString>;
58
+ database: zod3327.ZodString;
59
+ ssl: zod3327.ZodOptional<zod3327.ZodUnion<[zod3327.ZodLiteral<"require">, zod3327.ZodLiteral<"allow">, zod3327.ZodLiteral<"prefer">, zod3327.ZodLiteral<"verify-full">, zod3327.ZodBoolean, zod3327.ZodObject<{}, "passthrough", zod3327.ZodTypeAny, zod3327.objectOutputType<{}, zod3327.ZodTypeAny, "passthrough">, zod3327.objectInputType<{}, zod3327.ZodTypeAny, "passthrough">>]>>;
60
+ }, "strip", zod3327.ZodTypeAny, {
61
61
  host: string;
62
62
  database: string;
63
63
  port?: number | undefined;
64
64
  user?: string | undefined;
65
65
  password?: string | undefined;
66
- ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3349.objectOutputType<{}, zod3349.ZodTypeAny, "passthrough"> | undefined;
66
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3327.objectOutputType<{}, zod3327.ZodTypeAny, "passthrough"> | undefined;
67
67
  driver?: undefined;
68
68
  }, {
69
69
  host: string;
@@ -71,7 +71,7 @@ declare const postgresCredentials: zod3349.ZodUnion<[zod3349.ZodEffects<zod3349.
71
71
  port?: number | undefined;
72
72
  user?: string | undefined;
73
73
  password?: string | undefined;
74
- ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3349.objectInputType<{}, zod3349.ZodTypeAny, "passthrough"> | undefined;
74
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3327.objectInputType<{}, zod3327.ZodTypeAny, "passthrough"> | undefined;
75
75
  driver?: undefined;
76
76
  }>, Omit<{
77
77
  host: string;
@@ -79,7 +79,7 @@ declare const postgresCredentials: zod3349.ZodUnion<[zod3349.ZodEffects<zod3349.
79
79
  port?: number | undefined;
80
80
  user?: string | undefined;
81
81
  password?: string | undefined;
82
- ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3349.objectOutputType<{}, zod3349.ZodTypeAny, "passthrough"> | undefined;
82
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3327.objectOutputType<{}, zod3327.ZodTypeAny, "passthrough"> | undefined;
83
83
  driver?: undefined;
84
84
  }, "driver">, {
85
85
  host: string;
@@ -87,12 +87,12 @@ declare const postgresCredentials: zod3349.ZodUnion<[zod3349.ZodEffects<zod3349.
87
87
  port?: number | undefined;
88
88
  user?: string | undefined;
89
89
  password?: string | undefined;
90
- ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3349.objectInputType<{}, zod3349.ZodTypeAny, "passthrough"> | undefined;
90
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | zod3327.objectInputType<{}, zod3327.ZodTypeAny, "passthrough"> | undefined;
91
91
  driver?: undefined;
92
- }>, zod3349.ZodEffects<zod3349.ZodObject<{
93
- driver: zod3349.ZodUndefined;
94
- url: zod3349.ZodString;
95
- }, "strip", zod3349.ZodTypeAny, {
92
+ }>, zod3327.ZodEffects<zod3327.ZodObject<{
93
+ driver: zod3327.ZodUndefined;
94
+ url: zod3327.ZodString;
95
+ }, "strip", zod3327.ZodTypeAny, {
96
96
  url: string;
97
97
  driver?: undefined;
98
98
  }, {
@@ -103,12 +103,12 @@ declare const postgresCredentials: zod3349.ZodUnion<[zod3349.ZodEffects<zod3349.
103
103
  }, {
104
104
  url: string;
105
105
  driver?: undefined;
106
- }>, zod3349.ZodObject<{
107
- driver: zod3349.ZodLiteral<"aws-data-api">;
108
- database: zod3349.ZodString;
109
- secretArn: zod3349.ZodString;
110
- resourceArn: zod3349.ZodString;
111
- }, "strip", zod3349.ZodTypeAny, {
106
+ }>, zod3327.ZodObject<{
107
+ driver: zod3327.ZodLiteral<"aws-data-api">;
108
+ database: zod3327.ZodString;
109
+ secretArn: zod3327.ZodString;
110
+ resourceArn: zod3327.ZodString;
111
+ }, "strip", zod3327.ZodTypeAny, {
112
112
  database: string;
113
113
  driver: "aws-data-api";
114
114
  secretArn: string;
@@ -118,10 +118,10 @@ declare const postgresCredentials: zod3349.ZodUnion<[zod3349.ZodEffects<zod3349.
118
118
  driver: "aws-data-api";
119
119
  secretArn: string;
120
120
  resourceArn: string;
121
- }>, zod3349.ZodObject<{
122
- driver: zod3349.ZodLiteral<"pglite">;
123
- url: zod3349.ZodString;
124
- }, "strip", zod3349.ZodTypeAny, {
121
+ }>, zod3327.ZodObject<{
122
+ driver: zod3327.ZodLiteral<"pglite">;
123
+ url: zod3327.ZodString;
124
+ }, "strip", zod3327.ZodTypeAny, {
125
125
  url: string;
126
126
  driver: "pglite";
127
127
  }, {
package/api-postgres.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
- const require_ddl = require('./ddl-SsGc2gVn.js');
2
+ const require_ddl = require('./ddl-CBYB67K9.js');
3
3
  const require_utils = require('./utils-D2E5ChQ0.js');
4
- const require_grammar = require('./grammar-B2XVJ90y.js');
4
+ const require_grammar = require('./grammar-BCbIDJPD.js');
5
5
 
6
6
  //#region src/dialects/postgres/versions.ts
7
7
  const upToV8 = (it) => {
@@ -345,9 +345,9 @@ const updateToV5 = (it) => {
345
345
  //#region src/ext/api-postgres.ts
346
346
  const generateDrizzleJson = async (imports, prevId, schemaFilters, casing) => {
347
347
  const { prepareEntityFilter } = await Promise.resolve().then(() => require("./pull-utils-CrV6D2HD.js"));
348
- const { postgresSchemaError, postgresSchemaWarning } = await Promise.resolve().then(() => require("./views-BBN9LqYh.js"));
349
- const { toJsonSnapshot } = await Promise.resolve().then(() => require("./snapshot-BYJnEA9-.js"));
350
- const { fromDrizzleSchema, fromExports } = await Promise.resolve().then(() => require("./drizzle-CMnafYhh.js"));
348
+ const { postgresSchemaError, postgresSchemaWarning } = await Promise.resolve().then(() => require("./views-ROhqU4Mr.js"));
349
+ const { toJsonSnapshot } = await Promise.resolve().then(() => require("./snapshot-mHgK8Q_m.js"));
350
+ const { fromDrizzleSchema, fromExports } = await Promise.resolve().then(() => require("./drizzle-CEBrmf_E.js"));
351
351
  const { extractPostgresExisting } = await Promise.resolve().then(() => require("./drizzle-C5dbiai5.js"));
352
352
  const prepared = fromExports(imports);
353
353
  const existing = extractPostgresExisting(prepared.schemas, prepared.views, prepared.matViews);
@@ -370,8 +370,8 @@ const generateDrizzleJson = async (imports, prevId, schemaFilters, casing) => {
370
370
  return toJsonSnapshot(ddl, prevId ? [prevId] : [require_utils.originUUID], []);
371
371
  };
372
372
  const generateMigration = async (prev, cur) => {
373
- const { resolver } = await Promise.resolve().then(() => require("./prompts-4ijwXPKB.js"));
374
- const { ddlDiff } = await Promise.resolve().then(() => require("./diff-Cm7kIF-O.js"));
373
+ const { resolver } = await Promise.resolve().then(() => require("./prompts-5phnIDnC.js"));
374
+ const { ddlDiff } = await Promise.resolve().then(() => require("./diff-CHFyAuUb.js"));
375
375
  const from = require_ddl.createDDL();
376
376
  const to = require_ddl.createDDL();
377
377
  for (const it of prev.ddl) from.entities.push(it);
@@ -381,12 +381,12 @@ const generateMigration = async (prev, cur) => {
381
381
  };
382
382
  const pushSchema = async (imports, drizzleInstance, casing, entitiesConfig, migrationsConfig) => {
383
383
  const { prepareEntityFilter } = await Promise.resolve().then(() => require("./pull-utils-CrV6D2HD.js"));
384
- const { resolver } = await Promise.resolve().then(() => require("./prompts-4ijwXPKB.js"));
385
- const { fromDatabaseForDrizzle } = await Promise.resolve().then(() => require("./introspect-NQfgH1Vi.js"));
386
- const { fromDrizzleSchema, fromExports } = await Promise.resolve().then(() => require("./drizzle-CMnafYhh.js"));
387
- const { suggestions } = await Promise.resolve().then(() => require("./push-postgres-BUm3kPh_.js"));
384
+ const { resolver } = await Promise.resolve().then(() => require("./prompts-5phnIDnC.js"));
385
+ const { fromDatabaseForDrizzle } = await Promise.resolve().then(() => require("./introspect-Cq9J37B_.js"));
386
+ const { fromDrizzleSchema, fromExports } = await Promise.resolve().then(() => require("./drizzle-CEBrmf_E.js"));
387
+ const { suggestions } = await Promise.resolve().then(() => require("./push-postgres-P7sbAYqE.js"));
388
388
  const { extractPostgresExisting } = await Promise.resolve().then(() => require("./drizzle-C5dbiai5.js"));
389
- const { ddlDiff } = await Promise.resolve().then(() => require("./diff-Cm7kIF-O.js"));
389
+ const { ddlDiff } = await Promise.resolve().then(() => require("./diff-CHFyAuUb.js"));
390
390
  const { sql } = require("drizzle-orm");
391
391
  const migrations = {
392
392
  schema: migrationsConfig?.schema || "drizzle",
@@ -422,7 +422,7 @@ const startStudioServer = async (imports, credentials, options) => {
422
422
  const { is } = require("drizzle-orm");
423
423
  const { PgTable, getTableConfig } = require("drizzle-orm/pg-core");
424
424
  const { Relations } = require("drizzle-orm/_relations");
425
- const { drizzleForPostgres, prepareServer } = await Promise.resolve().then(() => require("./studio-e9LPrWEG.js"));
425
+ const { drizzleForPostgres, prepareServer } = await Promise.resolve().then(() => require("./studio-CbNHJGpE.js"));
426
426
  const pgSchema = {};
427
427
  const relations = {};
428
428
  Object.entries(imports).forEach(([k, t]) => {
package/api-postgres.mjs CHANGED
@@ -15883,8 +15883,8 @@ var init_grammar$4 = __esmMin((() => {
15883
15883
  return `${tableName}_${columns.join("_")}_index`;
15884
15884
  };
15885
15885
  isSerialExpression = (expr, schema$4) => {
15886
- const schemaPrefix = schema$4 === "public" ? "" : `${schema$4}.`;
15887
- return (expr.startsWith(`nextval('${schemaPrefix}`) || expr.startsWith(`nextval('"${schemaPrefix}`)) && (expr.endsWith(`_seq'::regclass)`) || expr.endsWith(`_seq"'::regclass)`));
15886
+ const schemaPrefix = schema$4 === "public" ? "" : `${schema$4}`;
15887
+ return (expr.startsWith(`nextval('${schemaPrefix}`) || expr.startsWith(`nextval('"${schemaPrefix}"${schemaPrefix ? "." : ""}`)) && (expr.endsWith(`_seq'::regclass)`) || expr.endsWith(`_seq"'::regclass)`));
15888
15888
  };
15889
15889
  parseOnType = (type) => {
15890
15890
  switch (type) {
@@ -26881,7 +26881,7 @@ var init_grammar$3 = __esmMin((() => {
26881
26881
  default: ""
26882
26882
  };
26883
26883
  const trimmed = trimChar(def, "'");
26884
- if (trimmed.includes("now(") || trimmed.includes("CURRENT_TIMESTAMP(")) return {
26884
+ if (trimmed.includes("now") || trimmed.includes("CURRENT_TIMESTAMP")) return {
26885
26885
  options,
26886
26886
  default: `sql\`${trimmed}\``
26887
26887
  };
@@ -75101,7 +75101,13 @@ var init_drizzle = __esmMin((() => {
75101
75101
  validUntil: role.validUntil ?? null
75102
75102
  });
75103
75103
  }
75104
- const combinedViews = [...schema$4.views, ...schema$4.matViews].map((it$1) => {
75104
+ const combinedViews = [...schema$4.views, ...schema$4.matViews].sort((a$4, b$4) => {
75105
+ const aConfig = is(a$4, PgView) ? getViewConfig(a$4) : getMaterializedViewConfig(a$4);
75106
+ const bConfig = is(b$4, PgView) ? getViewConfig(b$4) : getMaterializedViewConfig(b$4);
75107
+ if (aConfig.query?.queryChunks.includes(b$4)) return 1;
75108
+ if (bConfig.query?.queryChunks.includes(a$4)) return -1;
75109
+ return 0;
75110
+ }).map((it$1) => {
75105
75111
  if (is(it$1, PgView)) return {
75106
75112
  ...getViewConfig(it$1),
75107
75113
  materialized: false,
@@ -75836,7 +75842,8 @@ var init_convertor = __esmMin((() => {
75836
75842
  return `CREATE ${indexPart}${concur} "${name}" ON ${key}${method !== defaults$3.index.method ? ` USING ${method}` : ""} (${value$1})${withClause}${whereClause};`;
75837
75843
  });
75838
75844
  dropIndexConvertor = convertor("drop_index", (st$1) => {
75839
- return `DROP INDEX "${st$1.index.name}";`;
75845
+ const { schema: schema$4 } = st$1.index;
75846
+ return `DROP INDEX ${schema$4 !== "public" ? `"${schema$4}".` : ""}"${st$1.index.name}";`;
75840
75847
  });
75841
75848
  renameIndexConvertor = convertor("rename_index", (st$1) => {
75842
75849
  return `ALTER INDEX ${st$1.schema !== "public" ? `"${st$1.schema}"."${st$1.from}"` : `"${st$1.from}"`} RENAME TO "${st$1.to}";`;
@@ -219617,9 +219624,14 @@ var init_utils = __esmMin((() => {
219617
219624
  String.prototype.snake_case = function() {
219618
219625
  return this && this.length > 0 ? `${this.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`)}` : String(this);
219619
219626
  };
219620
- Array.prototype.random = function() {
219621
- return this[~~(Math.random() * this.length)];
219622
- };
219627
+ Object.defineProperty(Array.prototype, "random", {
219628
+ value: function() {
219629
+ return this[~~(Math.random() * this.length)];
219630
+ },
219631
+ enumerable: false,
219632
+ writable: true,
219633
+ configurable: true
219634
+ });
219623
219635
  }));
219624
219636
 
219625
219637
  //#endregion
@@ -221399,7 +221411,7 @@ var init_generate_common = __esmMin((() => {
221399
221411
  const js = embeddedMigrations([...snapshots || [], join(outFolder, `${tag$1}/snapshot.json`)], driver$1);
221400
221412
  fs.writeFileSync(`${outFolder}/migrations.js`, js);
221401
221413
  }
221402
- (0, import_hanji$2.render)(`[${source_default.green("✓")}] Your SQL migration ➜ ${source_default.bold.underline.blue(path.join(`${outFolder}/${tag$1}`))} 🚀`);
221414
+ (0, import_hanji$2.render)(`[${source_default.green("✓")}] Your SQL migration ➜ ${source_default.bold.underline.blue(path.join(`${outFolder}/${tag$1}/migration.sql`))} 🚀`);
221403
221415
  };
221404
221416
  embeddedMigrations = (snapshots, driver$1) => {
221405
221417
  let content = driver$1 === "expo" ? "// This file is required for Expo/React Native SQLite migrations - https://orm.drizzle.team/quick-sqlite/expo\n\n" : "";
package/api-sqlite.js CHANGED
@@ -5,7 +5,7 @@ const startStudioServer = async (imports, credentials, options) => {
5
5
  const { is } = require("drizzle-orm");
6
6
  const { SQLiteTable } = require("drizzle-orm/sqlite-core");
7
7
  const { Relations } = require("drizzle-orm/_relations");
8
- const { drizzleForSQLite, prepareServer } = await Promise.resolve().then(() => require("./studio-e9LPrWEG.js"));
8
+ const { drizzleForSQLite, prepareServer } = await Promise.resolve().then(() => require("./studio-CbNHJGpE.js"));
9
9
  const sqliteSchema = {};
10
10
  const relations = {};
11
11
  Object.entries(imports).forEach(([k, t]) => {
package/api-sqlite.mjs CHANGED
@@ -9371,7 +9371,7 @@ var init_grammar$4 = __esmMin((() => {
9371
9371
  default: ""
9372
9372
  };
9373
9373
  const trimmed = trimChar(def, "'");
9374
- if (trimmed.includes("now(") || trimmed.includes("CURRENT_TIMESTAMP(")) return {
9374
+ if (trimmed.includes("now") || trimmed.includes("CURRENT_TIMESTAMP")) return {
9375
9375
  options,
9376
9376
  default: `sql\`${trimmed}\``
9377
9377
  };
package/bin.cjs CHANGED
@@ -6875,9 +6875,14 @@ var init_utils$4 = __esmMin((() => {
6875
6875
  String.prototype.snake_case = function() {
6876
6876
  return this && this.length > 0 ? `${this.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`)}` : String(this);
6877
6877
  };
6878
- Array.prototype.random = function() {
6879
- return this[~~(Math.random() * this.length)];
6880
- };
6878
+ Object.defineProperty(Array.prototype, "random", {
6879
+ value: function() {
6880
+ return this[~~(Math.random() * this.length)];
6881
+ },
6882
+ enumerable: false,
6883
+ writable: true,
6884
+ configurable: true
6885
+ });
6881
6886
  }));
6882
6887
 
6883
6888
  //#endregion
@@ -10438,7 +10443,7 @@ var init_grammar$4 = __esmMin((() => {
10438
10443
  default: ""
10439
10444
  };
10440
10445
  const trimmed = trimChar(def, "'");
10441
- if (trimmed.includes("now(") || trimmed.includes("CURRENT_TIMESTAMP(")) return {
10446
+ if (trimmed.includes("now") || trimmed.includes("CURRENT_TIMESTAMP")) return {
10442
10447
  options,
10443
10448
  default: `sql\`${trimmed}\``
10444
10449
  };
@@ -27419,8 +27424,8 @@ var init_grammar$3 = __esmMin((() => {
27419
27424
  return `${tableName}_${columns.join("_")}_index`;
27420
27425
  };
27421
27426
  isSerialExpression = (expr, schema$4) => {
27422
- const schemaPrefix = schema$4 === "public" ? "" : `${schema$4}.`;
27423
- return (expr.startsWith(`nextval('${schemaPrefix}`) || expr.startsWith(`nextval('"${schemaPrefix}`)) && (expr.endsWith(`_seq'::regclass)`) || expr.endsWith(`_seq"'::regclass)`));
27427
+ const schemaPrefix = schema$4 === "public" ? "" : `${schema$4}`;
27428
+ return (expr.startsWith(`nextval('${schemaPrefix}`) || expr.startsWith(`nextval('"${schemaPrefix}"${schemaPrefix ? "." : ""}`)) && (expr.endsWith(`_seq'::regclass)`) || expr.endsWith(`_seq"'::regclass)`));
27424
27429
  };
27425
27430
  parseOnType$1 = (type) => {
27426
27431
  switch (type) {
@@ -80997,7 +81002,7 @@ var init_generate_common = __esmMin((() => {
80997
81002
  const js = embeddedMigrations([...snapshots || [], (0, path.join)(outFolder, `${tag$1}/snapshot.json`)], driver$1);
80998
81003
  fs.default.writeFileSync(`${outFolder}/migrations.js`, js);
80999
81004
  }
81000
- (0, import_hanji$17.render)(`[${source_default.green("✓")}] Your SQL migration ➜ ${source_default.bold.underline.blue(path.default.join(`${outFolder}/${tag$1}`))} 🚀`);
81005
+ (0, import_hanji$17.render)(`[${source_default.green("✓")}] Your SQL migration ➜ ${source_default.bold.underline.blue(path.default.join(`${outFolder}/${tag$1}/migration.sql`))} 🚀`);
81001
81006
  };
81002
81007
  embeddedMigrations = (snapshots, driver$1) => {
81003
81008
  let content = driver$1 === "expo" ? "// This file is required for Expo/React Native SQLite migrations - https://orm.drizzle.team/quick-sqlite/expo\n\n" : "";
@@ -84457,7 +84462,13 @@ var init_drizzle$5 = __esmMin((() => {
84457
84462
  validUntil: role.validUntil ?? null
84458
84463
  });
84459
84464
  }
84460
- const combinedViews = [...schema$4.views, ...schema$4.matViews].map((it$1) => {
84465
+ const combinedViews = [...schema$4.views, ...schema$4.matViews].sort((a$4, b$4) => {
84466
+ const aConfig = (0, drizzle_orm.is)(a$4, drizzle_orm_pg_core.PgView) ? (0, drizzle_orm_pg_core.getViewConfig)(a$4) : (0, drizzle_orm_pg_core.getMaterializedViewConfig)(a$4);
84467
+ const bConfig = (0, drizzle_orm.is)(b$4, drizzle_orm_pg_core.PgView) ? (0, drizzle_orm_pg_core.getViewConfig)(b$4) : (0, drizzle_orm_pg_core.getMaterializedViewConfig)(b$4);
84468
+ if (aConfig.query?.queryChunks.includes(b$4)) return 1;
84469
+ if (bConfig.query?.queryChunks.includes(a$4)) return -1;
84470
+ return 0;
84471
+ }).map((it$1) => {
84461
84472
  if ((0, drizzle_orm.is)(it$1, drizzle_orm_pg_core.PgView)) return {
84462
84473
  ...(0, drizzle_orm_pg_core.getViewConfig)(it$1),
84463
84474
  materialized: false,
@@ -85136,7 +85147,8 @@ var init_convertor$4 = __esmMin((() => {
85136
85147
  return `CREATE ${indexPart}${concur} "${name}" ON ${key}${method !== defaults$3.index.method ? ` USING ${method}` : ""} (${value$1})${withClause}${whereClause};`;
85137
85148
  });
85138
85149
  dropIndexConvertor$1 = convertor$4("drop_index", (st$1) => {
85139
- return `DROP INDEX "${st$1.index.name}";`;
85150
+ const { schema: schema$4 } = st$1.index;
85151
+ return `DROP INDEX ${schema$4 !== "public" ? `"${schema$4}".` : ""}"${st$1.index.name}";`;
85140
85152
  });
85141
85153
  renameIndexConvertor$1 = convertor$4("rename_index", (st$1) => {
85142
85154
  return `ALTER INDEX ${st$1.schema !== "public" ? `"${st$1.schema}"."${st$1.from}"` : `"${st$1.from}"`} RENAME TO "${st$1.to}";`;
@@ -86739,7 +86751,13 @@ var init_drizzle$4 = __esmMin((() => {
86739
86751
  });
86740
86752
  }
86741
86753
  }
86742
- for (const view$4 of views) {
86754
+ for (const view$4 of views.sort((a$4, b$4) => {
86755
+ const aConfig = (0, drizzle_orm_mysql_core.getViewConfig)(a$4);
86756
+ const bConfig = (0, drizzle_orm_mysql_core.getViewConfig)(b$4);
86757
+ if (aConfig.query?.queryChunks.includes(b$4)) return 1;
86758
+ if (bConfig.query?.queryChunks.includes(a$4)) return -1;
86759
+ return 0;
86760
+ })) {
86743
86761
  const { isExisting, name, query, selectedFields, algorithm, sqlSecurity, withCheckOption } = (0, drizzle_orm_mysql_core.getViewConfig)(view$4);
86744
86762
  if (isExisting) continue;
86745
86763
  for (const key in selectedFields) if ((0, drizzle_orm.is)(selectedFields[key], drizzle_orm_mysql_core.MySqlColumn)) {
@@ -86896,7 +86914,7 @@ var init_convertor$3 = __esmMin((() => {
86896
86914
  }
86897
86915
  if (pk && pk.columns.length > 1) {
86898
86916
  statement += ",\n";
86899
- statement += `\tCONSTRAINT \`${pk.name}\` PRIMARY KEY(\`${pk.columns.join(`\`,\``)}\`)`;
86917
+ statement += `\tCONSTRAINT PRIMARY KEY(\`${pk.columns.join(`\`,\``)}\`)`;
86900
86918
  }
86901
86919
  for (const unique of uniqueIndexes) {
86902
86920
  statement += ",\n";
@@ -88098,7 +88116,13 @@ var init_drizzle$3 = __esmMin((() => {
88098
88116
  };
88099
88117
  });
88100
88118
  }).flat(),
88101
- views: dViews.map((it$1) => {
88119
+ views: dViews.sort((a$4, b$4) => {
88120
+ const aConfig = (0, drizzle_orm_sqlite_core.getViewConfig)(a$4);
88121
+ const bConfig = (0, drizzle_orm_sqlite_core.getViewConfig)(b$4);
88122
+ if (aConfig.query?.queryChunks.includes(b$4)) return 1;
88123
+ if (bConfig.query?.queryChunks.includes(a$4)) return -1;
88124
+ return 0;
88125
+ }).map((it$1) => {
88102
88126
  const { name: viewName, isExisting, query } = (0, drizzle_orm_sqlite_core.getViewConfig)(it$1);
88103
88127
  return {
88104
88128
  entityType: "views",
@@ -89820,7 +89844,13 @@ var init_drizzle$1 = __esmMin((() => {
89820
89844
  });
89821
89845
  }
89822
89846
  }
89823
- for (const view$4 of schema$4.views) {
89847
+ for (const view$4 of schema$4.views.sort((a$4, b$4) => {
89848
+ const aConfig = (0, drizzle_orm_mssql_core.getViewConfig)(a$4);
89849
+ const bConfig = (0, drizzle_orm_mssql_core.getViewConfig)(b$4);
89850
+ if (aConfig.query?.queryChunks.includes(b$4)) return 1;
89851
+ if (bConfig.query?.queryChunks.includes(a$4)) return -1;
89852
+ return 0;
89853
+ })) {
89824
89854
  const { isExisting, name, query, schema: drizzleSchema, selectedFields, checkOption, encryption, schemaBinding, viewMetadata } = (0, drizzle_orm_mssql_core.getViewConfig)(view$4);
89825
89855
  if (isExisting) continue;
89826
89856
  if (!filter$1({
@@ -90377,7 +90407,13 @@ var init_drizzle = __esmMin((() => {
90377
90407
  createRole: role.createRole ?? false
90378
90408
  });
90379
90409
  }
90380
- const combinedViews = [...schema$4.views, ...schema$4.matViews].map((it$1) => {
90410
+ const combinedViews = [...schema$4.views, ...schema$4.matViews].sort((a$4, b$4) => {
90411
+ const aConfig = (0, drizzle_orm.is)(a$4, drizzle_orm_cockroach_core.CockroachView) ? (0, drizzle_orm_cockroach_core.getViewConfig)(a$4) : (0, drizzle_orm_cockroach_core.getMaterializedViewConfig)(a$4);
90412
+ const bConfig = (0, drizzle_orm.is)(b$4, drizzle_orm_cockroach_core.CockroachView) ? (0, drizzle_orm_cockroach_core.getViewConfig)(b$4) : (0, drizzle_orm_cockroach_core.getMaterializedViewConfig)(b$4);
90413
+ if (aConfig.query?.queryChunks.includes(b$4)) return 1;
90414
+ if (bConfig.query?.queryChunks.includes(a$4)) return -1;
90415
+ return 0;
90416
+ }).map((it$1) => {
90381
90417
  if ((0, drizzle_orm.is)(it$1, drizzle_orm_cockroach_core.CockroachView)) return {
90382
90418
  ...(0, drizzle_orm_cockroach_core.getViewConfig)(it$1),
90383
90419
  materialized: false,
@@ -108440,7 +108476,6 @@ var init_cbor$1 = __esmMin((() => {
108440
108476
  //#region ../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js
108441
108477
  var dateToTag, loadSmithyRpcV2CborErrorCode;
108442
108478
  var init_parseCborBody = __esmMin((() => {
108443
- init_protocols$1();
108444
108479
  init_cbor_types();
108445
108480
  dateToTag = (date$1) => {
108446
108481
  return tag({
@@ -235982,8 +236017,7 @@ var init_introspect$2 = __esmMin((() => {
235982
236017
  and m.tbl_name NOT LIKE 'libsql\\_%' ESCAPE '\\'
235983
236018
  and m.tbl_name NOT LIKE 'sqlite\\_%' ESCAPE '\\'
235984
236019
  and m.tbl_name NOT LIKE 'd1\\_%' ESCAPE '\\'
235985
- ORDER BY m.name COLLATE NOCASE, p.cid
235986
- ;
236020
+ ORDER BY m.name COLLATE NOCASE, p.cid;
235987
236021
  `).then((columns$1) => {
235988
236022
  queryCallback("viewColumns", columns$1, null);
235989
236023
  return columns$1.filter((it$1) => filter$1({
@@ -236397,7 +236431,10 @@ var init_typescript$2 = __esmMin((() => {
236397
236431
  }
236398
236432
  }
236399
236433
  for (const it$1 of Array.from(columnTypes.values())) imports$2.add(typeFor(it$1).drizzleImport());
236400
- for (const it$1 of Object.values(viewColumns).flat()) if (sqliteImports.has(it$1.type)) imports$2.add(it$1.type);
236434
+ for (const it$1 of Object.values(viewColumns).flat()) {
236435
+ const drizzleImport = typeFor(it$1.type).drizzleImport();
236436
+ if (sqliteImports.has(drizzleImport)) imports$2.add(drizzleImport);
236437
+ }
236401
236438
  const tableStatements = [];
236402
236439
  for (const table$5 of schema$4.tables.list()) {
236403
236440
  const columns = schema$4.columns.list({ table: table$5.name });
@@ -236534,7 +236571,11 @@ var init_typescript$2 = __esmMin((() => {
236534
236571
  let statement = "";
236535
236572
  for (const it$1 of columns) {
236536
236573
  const key = withCasing$2(it$1.name, casing$1);
236537
- statement += `${key}: ${it$1.type}()`;
236574
+ const grammarType = typeFor(it$1.type);
236575
+ const drizzleType = grammarType.drizzleImport();
236576
+ const res = grammarType.toTs(null, it$1.type);
236577
+ const { def: _def, customType } = typeof res === "string" ? { def: res } : res;
236578
+ statement += `${key}: ${drizzleType}${drizzleType === "customType" ? `({ dataType: () => '${!customType ? "unknown" : customType}' })` : ""}()`;
236538
236579
  statement += it$1.notNull ? ".notNull()" : "";
236539
236580
  statement += ",\n";
236540
236581
  }
@@ -242472,7 +242513,7 @@ init_views();
242472
242513
  const version = async () => {
242473
242514
  const { npmVersion } = await ormCoreVersions();
242474
242515
  const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
242475
- const envVersion = "1.0.0-beta.13";
242516
+ const envVersion = "1.0.0-beta.14";
242476
242517
  const versions = `drizzle-kit: ${envVersion ? `v${envVersion}` : "--"}\n${ormVersion}`;
242477
242518
  console.log(source_default.gray(versions), "\n");
242478
242519
  };
@@ -1,11 +1,11 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
- require('./ddl-SsGc2gVn.js');
2
+ require('./ddl-CBYB67K9.js');
3
3
  const require_utils = require('./utils-D2E5ChQ0.js');
4
- const require_grammar = require('./grammar-B2XVJ90y.js');
5
- const require_views = require('./views-BA7qJeG7.js');
6
- require('./snapshot-BG6vPgbm.js');
4
+ const require_grammar = require('./grammar-BCbIDJPD.js');
5
+ const require_views = require('./views-D-Ks5Xze.js');
6
+ require('./snapshot-DkerbnYq.js');
7
7
  require('./brace-expansion-BfFnz-Zg.js');
8
- const require_utils_node = require('./utils-node-dF5q2lce.js');
8
+ const require_utils_node = require('./utils-node-Cv4a4GPT.js');
9
9
  const require_dist_cjs = require('./dist-cjs-CkGeK2g2.js');
10
10
  let node_https = require("node:https");
11
11
  node_https = require_chunk.__toESM(node_https);
@@ -1,4 +1,4 @@
1
- const require_grammar = require('./grammar-B2XVJ90y.js');
1
+ const require_grammar = require('./grammar-BCbIDJPD.js');
2
2
 
3
3
  //#region src/dialects/dialect.ts
4
4
  const commonConfig = {
@@ -1,6 +1,6 @@
1
- const require_ddl = require('./ddl-SsGc2gVn.js');
1
+ const require_ddl = require('./ddl-CBYB67K9.js');
2
2
  const require_utils = require('./utils-D2E5ChQ0.js');
3
- const require_grammar = require('./grammar-B2XVJ90y.js');
3
+ const require_grammar = require('./grammar-BCbIDJPD.js');
4
4
 
5
5
  //#region src/utils/node-assert/deep-strict-equal.ts
6
6
  var AssertionError = class extends Error {
@@ -467,7 +467,8 @@ const createIndexConvertor = convertor("create_index", (st) => {
467
467
  return `CREATE ${indexPart}${concur} "${name}" ON ${key}${method !== require_grammar.defaults.index.method ? ` USING ${method}` : ""} (${value})${withClause}${whereClause};`;
468
468
  });
469
469
  const dropIndexConvertor = convertor("drop_index", (st) => {
470
- return `DROP INDEX "${st.index.name}";`;
470
+ const { schema } = st.index;
471
+ return `DROP INDEX ${schema !== "public" ? `"${schema}".` : ""}"${st.index.name}";`;
471
472
  });
472
473
  const renameIndexConvertor = convertor("rename_index", (st) => {
473
474
  return `ALTER INDEX ${st.schema !== "public" ? `"${st.schema}"."${st.from}"` : `"${st.from}"`} RENAME TO "${st.to}";`;
@@ -0,0 +1,6 @@
1
+ const require_chunk = require('./chunk-CdAKIUsw.js');
2
+ require('./ddl-CBYB67K9.js');
3
+ require('./grammar-BCbIDJPD.js');
4
+ const require_diff = require('./diff-B6qb2uLu.js');
5
+
6
+ exports.ddlDiff = require_diff.ddlDiff;
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
2
  const require_utils = require('./utils-D2E5ChQ0.js');
3
- const require_grammar = require('./grammar-B2XVJ90y.js');
3
+ const require_grammar = require('./grammar-BCbIDJPD.js');
4
4
  const require_drizzle = require('./drizzle-BfPXPbBQ.js');
5
5
  let drizzle_orm = require("drizzle-orm");
6
6
  let drizzle_orm__relations = require("drizzle-orm/_relations");
@@ -379,7 +379,13 @@ const fromDrizzleSchema = (schema, casing, filter) => {
379
379
  validUntil: role.validUntil ?? null
380
380
  });
381
381
  }
382
- const combinedViews = [...schema.views, ...schema.matViews].map((it) => {
382
+ const combinedViews = [...schema.views, ...schema.matViews].sort((a, b) => {
383
+ const aConfig = (0, drizzle_orm.is)(a, drizzle_orm_pg_core.PgView) ? (0, drizzle_orm_pg_core.getViewConfig)(a) : (0, drizzle_orm_pg_core.getMaterializedViewConfig)(a);
384
+ const bConfig = (0, drizzle_orm.is)(b, drizzle_orm_pg_core.PgView) ? (0, drizzle_orm_pg_core.getViewConfig)(b) : (0, drizzle_orm_pg_core.getMaterializedViewConfig)(b);
385
+ if (aConfig.query?.queryChunks.includes(b)) return 1;
386
+ if (bConfig.query?.queryChunks.includes(a)) return -1;
387
+ return 0;
388
+ }).map((it) => {
383
389
  if ((0, drizzle_orm.is)(it, drizzle_orm_pg_core.PgView)) return {
384
390
  ...(0, drizzle_orm_pg_core.getViewConfig)(it),
385
391
  materialized: false,
@@ -0,0 +1,12 @@
1
+ const require_chunk = require('./chunk-CdAKIUsw.js');
2
+ require('./ddl-CBYB67K9.js');
3
+ require('./grammar-BCbIDJPD.js');
4
+ require('./views-D-Ks5Xze.js');
5
+ require('./snapshot-DkerbnYq.js');
6
+ require('./brace-expansion-BfFnz-Zg.js');
7
+ require('./utils-node-Cv4a4GPT.js');
8
+ require('./drizzle-BfPXPbBQ.js');
9
+ const require_drizzle$1 = require('./drizzle-0gq0ODtS.js');
10
+
11
+ exports.fromDrizzleSchema = require_drizzle$1.fromDrizzleSchema;
12
+ exports.fromExports = require_drizzle$1.fromExports;
@@ -8083,8 +8083,8 @@ function minRangeForIdentityBasedOn(columnType) {
8083
8083
  return columnType === "integer" ? "-2147483648" : columnType === "bigint" ? "-9223372036854775808" : "-32768";
8084
8084
  }
8085
8085
  const isSerialExpression = (expr, schema) => {
8086
- const schemaPrefix = schema === "public" ? "" : `${schema}.`;
8087
- return (expr.startsWith(`nextval('${schemaPrefix}`) || expr.startsWith(`nextval('"${schemaPrefix}`)) && (expr.endsWith(`_seq'::regclass)`) || expr.endsWith(`_seq"'::regclass)`));
8086
+ const schemaPrefix = schema === "public" ? "" : `${schema}`;
8087
+ return (expr.startsWith(`nextval('${schemaPrefix}`) || expr.startsWith(`nextval('"${schemaPrefix}"${schemaPrefix ? "." : ""}`)) && (expr.endsWith(`_seq'::regclass)`) || expr.endsWith(`_seq"'::regclass)`));
8088
8088
  };
8089
8089
  function stringFromDatabaseIdentityProperty(field) {
8090
8090
  return typeof field === "string" ? field : typeof field === "undefined" || field === null ? null : typeof field === "bigint" ? field.toString() : String(field);
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
2
  const require_utils = require('./utils-D2E5ChQ0.js');
3
- const require_grammar = require('./grammar-B2XVJ90y.js');
3
+ const require_grammar = require('./grammar-BCbIDJPD.js');
4
4
 
5
5
  //#region ../node_modules/.pnpm/camelcase@7.0.1/node_modules/camelcase/index.js
6
6
  const UPPERCASE = /[\p{Lu}]/u;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "1.0.0-beta.13-4ef3fca",
3
+ "version": "1.0.0-beta.14-89db290",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -0,0 +1,6 @@
1
+ const require_chunk = require('./chunk-CdAKIUsw.js');
2
+ require('./grammar-BCbIDJPD.js');
3
+ require('./views-D-Ks5Xze.js');
4
+ const require_prompts = require('./prompts-DI1S9FNK.js');
5
+
6
+ exports.resolver = require_prompts.resolver;
@@ -1,4 +1,4 @@
1
- const require_views = require('./views-BA7qJeG7.js');
1
+ const require_views = require('./views-D-Ks5Xze.js');
2
2
 
3
3
  //#region src/cli/prompts.ts
4
4
  var import_hanji = require_views.require_hanji();
@@ -1,15 +1,15 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
- require('./ddl-SsGc2gVn.js');
3
- require('./grammar-B2XVJ90y.js');
4
- const require_views = require('./views-BA7qJeG7.js');
5
- require('./snapshot-BG6vPgbm.js');
2
+ require('./ddl-CBYB67K9.js');
3
+ require('./grammar-BCbIDJPD.js');
4
+ const require_views = require('./views-D-Ks5Xze.js');
5
+ require('./snapshot-DkerbnYq.js');
6
6
  require('./brace-expansion-BfFnz-Zg.js');
7
7
  require('./pull-utils-DDU5rq0R.js');
8
- require('./diff-ss2kcRXi.js');
9
- require('./utils-node-dF5q2lce.js');
10
- require('./prompts-CF9zxmUG.js');
8
+ require('./diff-B6qb2uLu.js');
9
+ require('./utils-node-Cv4a4GPT.js');
10
+ require('./prompts-DI1S9FNK.js');
11
11
  require('./drizzle-BfPXPbBQ.js');
12
- require('./drizzle-D-GiuQ98.js');
12
+ require('./drizzle-0gq0ODtS.js');
13
13
 
14
14
  //#region src/cli/selector-ui.ts
15
15
  var import_hanji$1 = require_views.require_hanji();
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
- const require_ddl = require('./ddl-SsGc2gVn.js');
2
+ const require_ddl = require('./ddl-CBYB67K9.js');
3
3
  const require_utils = require('./utils-D2E5ChQ0.js');
4
4
  const require_types = require('./types-KQgd7P_m.js');
5
5
  let crypto = require("crypto");
@@ -0,0 +1,6 @@
1
+ const require_chunk = require('./chunk-CdAKIUsw.js');
2
+ require('./ddl-CBYB67K9.js');
3
+ require('./grammar-BCbIDJPD.js');
4
+ const require_snapshot = require('./snapshot-DkerbnYq.js');
5
+
6
+ exports.toJsonSnapshot = require_snapshot.toJsonSnapshot;
@@ -1,12 +1,12 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
- require('./ddl-SsGc2gVn.js');
2
+ require('./ddl-CBYB67K9.js');
3
3
  const require_utils = require('./utils-D2E5ChQ0.js');
4
- const require_grammar = require('./grammar-B2XVJ90y.js');
5
- require('./views-BA7qJeG7.js');
4
+ const require_grammar = require('./grammar-BCbIDJPD.js');
5
+ require('./views-D-Ks5Xze.js');
6
6
  const require_types = require('./types-KQgd7P_m.js');
7
- require('./snapshot-BG6vPgbm.js');
7
+ require('./snapshot-DkerbnYq.js');
8
8
  require('./brace-expansion-BfFnz-Zg.js');
9
- require('./utils-node-dF5q2lce.js');
9
+ require('./utils-node-Cv4a4GPT.js');
10
10
  const require_drizzle = require('./drizzle-BfPXPbBQ.js');
11
11
  let crypto$1 = require("crypto");
12
12
  crypto$1 = require_chunk.__toESM(crypto$1);
@@ -1966,7 +1966,7 @@ const getCustomDefaults = (schema$1, casing) => {
1966
1966
  return customDefaults;
1967
1967
  };
1968
1968
  const drizzleForPostgres = async (credentials, pgSchema, relations, schemaFiles, casing) => {
1969
- const { preparePostgresDB } = await Promise.resolve().then(() => require("./connections-CWjZXeJG.js"));
1969
+ const { preparePostgresDB } = await Promise.resolve().then(() => require("./connections-DS9Khs41.js"));
1970
1970
  const db = await preparePostgresDB(credentials);
1971
1971
  const customDefaults = getCustomDefaults(pgSchema, casing);
1972
1972
  let dbUrl;
@@ -1993,7 +1993,7 @@ const drizzleForPostgres = async (credentials, pgSchema, relations, schemaFiles,
1993
1993
  };
1994
1994
  };
1995
1995
  const drizzleForMySQL = async (credentials, mysqlSchema, relations, schemaFiles, casing) => {
1996
- const { connectToMySQL } = await Promise.resolve().then(() => require("./connections-CWjZXeJG.js"));
1996
+ const { connectToMySQL } = await Promise.resolve().then(() => require("./connections-DS9Khs41.js"));
1997
1997
  const { proxy, transactionProxy, benchmarkProxy, database, packageName } = await connectToMySQL(credentials);
1998
1998
  const customDefaults = getCustomDefaults(mysqlSchema, casing);
1999
1999
  let dbUrl;
@@ -2015,7 +2015,7 @@ const drizzleForMySQL = async (credentials, mysqlSchema, relations, schemaFiles,
2015
2015
  };
2016
2016
  };
2017
2017
  const drizzleForSQLite = async (credentials, sqliteSchema, relations, schemaFiles, casing) => {
2018
- const { connectToSQLite } = await Promise.resolve().then(() => require("./connections-CWjZXeJG.js"));
2018
+ const { connectToSQLite } = await Promise.resolve().then(() => require("./connections-DS9Khs41.js"));
2019
2019
  const sqliteDB = await connectToSQLite(credentials);
2020
2020
  const customDefaults = getCustomDefaults(sqliteSchema, casing);
2021
2021
  let dbUrl;
@@ -1,9 +1,9 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
- const require_ddl = require('./ddl-SsGc2gVn.js');
2
+ const require_ddl = require('./ddl-CBYB67K9.js');
3
3
  const require_utils = require('./utils-D2E5ChQ0.js');
4
- const require_grammar = require('./grammar-B2XVJ90y.js');
4
+ const require_grammar = require('./grammar-BCbIDJPD.js');
5
5
  const require_types = require('./types-KQgd7P_m.js');
6
- const require_snapshot = require('./snapshot-BG6vPgbm.js');
6
+ const require_snapshot = require('./snapshot-DkerbnYq.js');
7
7
  const require_brace_expansion$1 = require('./brace-expansion-BfFnz-Zg.js');
8
8
  let _js_temporal_polyfill = require("@js-temporal/polyfill");
9
9
  let crypto = require("crypto");
@@ -2054,7 +2054,7 @@ const DateTime = {
2054
2054
  default: ""
2055
2055
  };
2056
2056
  const trimmed = require_utils.trimChar(def, "'");
2057
- if (trimmed.includes("now(") || trimmed.includes("CURRENT_TIMESTAMP(")) return {
2057
+ if (trimmed.includes("now") || trimmed.includes("CURRENT_TIMESTAMP")) return {
2058
2058
  options,
2059
2059
  default: `sql\`${trimmed}\``
2060
2060
  };
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
2
  const require_utils$1 = require('./utils-D2E5ChQ0.js');
3
- const require_grammar = require('./grammar-B2XVJ90y.js');
3
+ const require_grammar = require('./grammar-BCbIDJPD.js');
4
4
  const require_types = require('./types-KQgd7P_m.js');
5
5
  let node_process = require("node:process");
6
6
  node_process = require_chunk.__toESM(node_process);
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-CdAKIUsw.js');
2
- require('./grammar-B2XVJ90y.js');
3
- const require_views = require('./views-BA7qJeG7.js');
2
+ require('./grammar-BCbIDJPD.js');
3
+ const require_views = require('./views-D-Ks5Xze.js');
4
4
 
5
5
  exports.postgresSchemaError = require_views.postgresSchemaError;
6
6
  exports.postgresSchemaWarning = require_views.postgresSchemaWarning;
package/diff-Cm7kIF-O.js DELETED
@@ -1,6 +0,0 @@
1
- const require_chunk = require('./chunk-CdAKIUsw.js');
2
- require('./ddl-SsGc2gVn.js');
3
- require('./grammar-B2XVJ90y.js');
4
- const require_diff = require('./diff-ss2kcRXi.js');
5
-
6
- exports.ddlDiff = require_diff.ddlDiff;
@@ -1,12 +0,0 @@
1
- const require_chunk = require('./chunk-CdAKIUsw.js');
2
- require('./ddl-SsGc2gVn.js');
3
- require('./grammar-B2XVJ90y.js');
4
- require('./views-BA7qJeG7.js');
5
- require('./snapshot-BG6vPgbm.js');
6
- require('./brace-expansion-BfFnz-Zg.js');
7
- require('./utils-node-dF5q2lce.js');
8
- require('./drizzle-BfPXPbBQ.js');
9
- const require_drizzle$1 = require('./drizzle-D-GiuQ98.js');
10
-
11
- exports.fromDrizzleSchema = require_drizzle$1.fromDrizzleSchema;
12
- exports.fromExports = require_drizzle$1.fromExports;
@@ -1,6 +0,0 @@
1
- const require_chunk = require('./chunk-CdAKIUsw.js');
2
- require('./grammar-B2XVJ90y.js');
3
- require('./views-BA7qJeG7.js');
4
- const require_prompts = require('./prompts-CF9zxmUG.js');
5
-
6
- exports.resolver = require_prompts.resolver;
@@ -1,6 +0,0 @@
1
- const require_chunk = require('./chunk-CdAKIUsw.js');
2
- require('./ddl-SsGc2gVn.js');
3
- require('./grammar-B2XVJ90y.js');
4
- const require_snapshot = require('./snapshot-BG6vPgbm.js');
5
-
6
- exports.toJsonSnapshot = require_snapshot.toJsonSnapshot;