drizzle-kit 0.24.2-dab63b8 → 0.24.2-dc783a2

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.mts CHANGED
@@ -127,6 +127,13 @@ type Config = {
127
127
  introspect?: {
128
128
  casing: 'camel' | 'preserve';
129
129
  };
130
+ entities?: {
131
+ roles?: boolean | {
132
+ provider?: string;
133
+ exclude?: string[];
134
+ include?: string[];
135
+ }[];
136
+ };
130
137
  } & ({
131
138
  dialect: Verify<Dialect, 'turso'>;
132
139
  dbCredentials: {
package/index.d.ts CHANGED
@@ -127,6 +127,13 @@ type Config = {
127
127
  introspect?: {
128
128
  casing: 'camel' | 'preserve';
129
129
  };
130
+ entities?: {
131
+ roles?: boolean | {
132
+ provider?: string;
133
+ exclude?: string[];
134
+ include?: string[];
135
+ }[];
136
+ };
130
137
  } & ({
131
138
  dialect: Verify<Dialect, 'turso'>;
132
139
  dbCredentials: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.24.2-dab63b8",
3
+ "version": "0.24.2-dc783a2",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -51,7 +51,7 @@
51
51
  "@arethetypeswrong/cli": "^0.15.3",
52
52
  "@aws-sdk/client-rds-data": "^3.556.0",
53
53
  "@cloudflare/workers-types": "^4.20230518.0",
54
- "@electric-sql/pglite": "^0.1.5",
54
+ "@electric-sql/pglite": "^0.2.5",
55
55
  "@hono/node-server": "^1.9.0",
56
56
  "@hono/zod-validator": "^0.2.1",
57
57
  "@libsql/client": "^0.10.0",
package/utils.js CHANGED
@@ -5147,6 +5147,12 @@ var sequenceSchema = objectType({
5147
5147
  cycle: booleanType().optional(),
5148
5148
  schema: stringType()
5149
5149
  }).strict();
5150
+ var roleSchema = objectType({
5151
+ name: stringType(),
5152
+ createDb: booleanType().optional(),
5153
+ createRole: booleanType().optional(),
5154
+ inherit: booleanType().optional()
5155
+ }).strict();
5150
5156
  var sequenceSquashed = objectType({
5151
5157
  name: stringType(),
5152
5158
  schema: stringType(),
@@ -5210,6 +5216,14 @@ var uniqueConstraint2 = objectType({
5210
5216
  columns: stringType().array(),
5211
5217
  nullsNotDistinct: booleanType()
5212
5218
  }).strict();
5219
+ var policy = objectType({
5220
+ name: stringType(),
5221
+ as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
5222
+ for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
5223
+ to: stringType().array().optional(),
5224
+ using: stringType().optional(),
5225
+ withCheck: stringType().optional()
5226
+ }).strict();
5213
5227
  var tableV42 = objectType({
5214
5228
  name: stringType(),
5215
5229
  schema: stringType(),
@@ -5251,7 +5265,8 @@ var table2 = objectType({
5251
5265
  indexes: recordType(stringType(), index2),
5252
5266
  foreignKeys: recordType(stringType(), fk2),
5253
5267
  compositePrimaryKeys: recordType(stringType(), compositePK2),
5254
- uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
5268
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
5269
+ policies: recordType(stringType(), policy).default({})
5255
5270
  }).strict();
5256
5271
  var schemaHash2 = objectType({
5257
5272
  id: stringType(),
@@ -5345,6 +5360,7 @@ var pgSchemaInternal = objectType({
5345
5360
  enums: recordType(stringType(), enumSchema),
5346
5361
  schemas: recordType(stringType(), stringType()),
5347
5362
  sequences: recordType(stringType(), sequenceSchema).default({}),
5363
+ roles: recordType(stringType(), roleSchema).default({}),
5348
5364
  _meta: objectType({
5349
5365
  schemas: recordType(stringType(), stringType()),
5350
5366
  tables: recordType(stringType(), stringType()),
@@ -5359,7 +5375,8 @@ var tableSquashed2 = objectType({
5359
5375
  indexes: recordType(stringType(), stringType()),
5360
5376
  foreignKeys: recordType(stringType(), stringType()),
5361
5377
  compositePrimaryKeys: recordType(stringType(), stringType()),
5362
- uniqueConstraints: recordType(stringType(), stringType())
5378
+ uniqueConstraints: recordType(stringType(), stringType()),
5379
+ policies: recordType(stringType(), stringType())
5363
5380
  }).strict();
5364
5381
  var tableSquashedV42 = objectType({
5365
5382
  name: stringType(),
@@ -5388,7 +5405,8 @@ var pgSchemaSquashed = objectType({
5388
5405
  tables: recordType(stringType(), tableSquashed2),
5389
5406
  enums: recordType(stringType(), enumSchema),
5390
5407
  schemas: recordType(stringType(), stringType()),
5391
- sequences: recordType(stringType(), sequenceSquashed)
5408
+ sequences: recordType(stringType(), sequenceSquashed),
5409
+ roles: recordType(stringType(), roleSchema).default({})
5392
5410
  }).strict();
5393
5411
  var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
5394
5412
  var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
package/utils.mjs CHANGED
@@ -5126,6 +5126,12 @@ var sequenceSchema = objectType({
5126
5126
  cycle: booleanType().optional(),
5127
5127
  schema: stringType()
5128
5128
  }).strict();
5129
+ var roleSchema = objectType({
5130
+ name: stringType(),
5131
+ createDb: booleanType().optional(),
5132
+ createRole: booleanType().optional(),
5133
+ inherit: booleanType().optional()
5134
+ }).strict();
5129
5135
  var sequenceSquashed = objectType({
5130
5136
  name: stringType(),
5131
5137
  schema: stringType(),
@@ -5189,6 +5195,14 @@ var uniqueConstraint2 = objectType({
5189
5195
  columns: stringType().array(),
5190
5196
  nullsNotDistinct: booleanType()
5191
5197
  }).strict();
5198
+ var policy = objectType({
5199
+ name: stringType(),
5200
+ as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
5201
+ for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
5202
+ to: stringType().array().optional(),
5203
+ using: stringType().optional(),
5204
+ withCheck: stringType().optional()
5205
+ }).strict();
5192
5206
  var tableV42 = objectType({
5193
5207
  name: stringType(),
5194
5208
  schema: stringType(),
@@ -5230,7 +5244,8 @@ var table2 = objectType({
5230
5244
  indexes: recordType(stringType(), index2),
5231
5245
  foreignKeys: recordType(stringType(), fk2),
5232
5246
  compositePrimaryKeys: recordType(stringType(), compositePK2),
5233
- uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
5247
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
5248
+ policies: recordType(stringType(), policy).default({})
5234
5249
  }).strict();
5235
5250
  var schemaHash2 = objectType({
5236
5251
  id: stringType(),
@@ -5324,6 +5339,7 @@ var pgSchemaInternal = objectType({
5324
5339
  enums: recordType(stringType(), enumSchema),
5325
5340
  schemas: recordType(stringType(), stringType()),
5326
5341
  sequences: recordType(stringType(), sequenceSchema).default({}),
5342
+ roles: recordType(stringType(), roleSchema).default({}),
5327
5343
  _meta: objectType({
5328
5344
  schemas: recordType(stringType(), stringType()),
5329
5345
  tables: recordType(stringType(), stringType()),
@@ -5338,7 +5354,8 @@ var tableSquashed2 = objectType({
5338
5354
  indexes: recordType(stringType(), stringType()),
5339
5355
  foreignKeys: recordType(stringType(), stringType()),
5340
5356
  compositePrimaryKeys: recordType(stringType(), stringType()),
5341
- uniqueConstraints: recordType(stringType(), stringType())
5357
+ uniqueConstraints: recordType(stringType(), stringType()),
5358
+ policies: recordType(stringType(), stringType())
5342
5359
  }).strict();
5343
5360
  var tableSquashedV42 = objectType({
5344
5361
  name: stringType(),
@@ -5367,7 +5384,8 @@ var pgSchemaSquashed = objectType({
5367
5384
  tables: recordType(stringType(), tableSquashed2),
5368
5385
  enums: recordType(stringType(), enumSchema),
5369
5386
  schemas: recordType(stringType(), stringType()),
5370
- sequences: recordType(stringType(), sequenceSquashed)
5387
+ sequences: recordType(stringType(), sequenceSquashed),
5388
+ roles: recordType(stringType(), roleSchema).default({})
5371
5389
  }).strict();
5372
5390
  var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
5373
5391
  var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);