drizzle-orm 0.32.0-4ed01aa → 0.32.0-857ba54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-orm",
3
- "version": "0.32.0-4ed01aa",
3
+ "version": "0.32.0-857ba54",
4
4
  "description": "Drizzle ORM package for SQL databases",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -28,7 +28,7 @@ class PgIntColumnBaseBuilder extends import_common.PgColumnBuilder {
28
28
  static [import_entity.entityKind] = "PgIntColumnBaseBuilder";
29
29
  generatedAlwaysAsIdentity(sequence) {
30
30
  if (sequence) {
31
- if ((0, import_entity.is)(sequence, import_sequence.PgSequence)) {
31
+ if ((0, import_sequence.isPgSequence)(sequence)) {
32
32
  this.config.generatedIdentity = {
33
33
  type: "always",
34
34
  sequenceName: sequence.seqName,
@@ -47,7 +47,7 @@ class PgIntColumnBaseBuilder extends import_common.PgColumnBuilder {
47
47
  }
48
48
  generatedByDefaultAsIdentity(sequence) {
49
49
  if (sequence) {
50
- if ((0, import_entity.is)(sequence, import_sequence.PgSequence)) {
50
+ if ((0, import_sequence.isPgSequence)(sequence)) {
51
51
  this.config.generatedIdentity = {
52
52
  type: "byDefault",
53
53
  sequenceName: sequence.seqName,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/pg-core/columns/int.common.ts"],"sourcesContent":["import type {\n\tColumnBuilderBaseConfig,\n\tColumnDataType,\n\tGeneratedIdentityConfig,\n\tIsIdentityByDefault,\n} from '~/column-builder.ts';\nimport { entityKind, is } from '~/entity.ts';\nimport { PgSequence } from '../sequence.ts';\nimport type { PgSequenceOptions } from '../sequence.ts';\nimport { PgColumnBuilder } from './common.ts';\n\nexport abstract class PgIntColumnBaseBuilder<\n\tT extends ColumnBuilderBaseConfig<ColumnDataType, string>,\n> extends PgColumnBuilder<\n\tT,\n\t{ generatedIdentity: GeneratedIdentityConfig }\n> {\n\tstatic readonly [entityKind]: string = 'PgIntColumnBaseBuilder';\n\n\tgeneratedAlwaysAsIdentity(\n\t\tsequence?: PgSequenceOptions & { name?: string } | PgSequence,\n\t): IsIdentityByDefault<this, 'always'> {\n\t\tif (sequence) {\n\t\t\tif (is(sequence, PgSequence)) {\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'always',\n\t\t\t\t\tsequenceName: sequence.seqName,\n\t\t\t\t\tsequenceOptions: sequence.seqOptions,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst { name, ...options } = sequence;\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'always',\n\t\t\t\t\tsequenceName: name,\n\t\t\t\t\tsequenceOptions: options,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn this as any;\n\t}\n\n\tgeneratedByDefaultAsIdentity(\n\t\tsequence?: PgSequenceOptions & { name?: string } | PgSequence,\n\t): IsIdentityByDefault<this, 'byDefault'> {\n\t\tif (sequence) {\n\t\t\tif (is(sequence, PgSequence)) {\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'byDefault',\n\t\t\t\t\tsequenceName: sequence.seqName,\n\t\t\t\t\tsequenceOptions: sequence.seqOptions,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst { name, ...options } = sequence;\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'byDefault',\n\t\t\t\t\tsequenceName: name,\n\t\t\t\t\tsequenceOptions: options,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn this as any;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAA+B;AAC/B,sBAA2B;AAE3B,oBAAgC;AAEzB,MAAe,+BAEZ,8BAGR;AAAA,EACD,QAAiB,wBAAU,IAAY;AAAA,EAEvC,0BACC,UACsC;AACtC,QAAI,UAAU;AACb,cAAI,kBAAG,UAAU,0BAAU,GAAG;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,QAC3B;AAAA,MACD,OAAO;AACN,cAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc;AAAA,UACd,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,6BACC,UACyC;AACzC,QAAI,UAAU;AACb,cAAI,kBAAG,UAAU,0BAAU,GAAG;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,QAC3B;AAAA,MACD,OAAO;AACN,cAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc;AAAA,UACd,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/pg-core/columns/int.common.ts"],"sourcesContent":["import type {\n\tColumnBuilderBaseConfig,\n\tColumnDataType,\n\tGeneratedIdentityConfig,\n\tIsIdentityByDefault,\n} from '~/column-builder.ts';\nimport { entityKind } from '~/entity.ts';\nimport { isPgSequence } from '../sequence.ts';\nimport type { PgSequence, PgSequenceOptions } from '../sequence.ts';\nimport { PgColumnBuilder } from './common.ts';\n\nexport abstract class PgIntColumnBaseBuilder<\n\tT extends ColumnBuilderBaseConfig<ColumnDataType, string>,\n> extends PgColumnBuilder<\n\tT,\n\t{ generatedIdentity: GeneratedIdentityConfig }\n> {\n\tstatic readonly [entityKind]: string = 'PgIntColumnBaseBuilder';\n\n\tgeneratedAlwaysAsIdentity(\n\t\tsequence?: PgSequenceOptions & { name?: string } | PgSequence,\n\t): IsIdentityByDefault<this, 'always'> {\n\t\tif (sequence) {\n\t\t\tif (isPgSequence(sequence)) {\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'always',\n\t\t\t\t\tsequenceName: sequence.seqName,\n\t\t\t\t\tsequenceOptions: sequence.seqOptions,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst { name, ...options } = sequence;\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'always',\n\t\t\t\t\tsequenceName: name,\n\t\t\t\t\tsequenceOptions: options,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn this as any;\n\t}\n\n\tgeneratedByDefaultAsIdentity(\n\t\tsequence?: PgSequenceOptions & { name?: string } | PgSequence,\n\t): IsIdentityByDefault<this, 'byDefault'> {\n\t\tif (sequence) {\n\t\t\tif (isPgSequence(sequence)) {\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'byDefault',\n\t\t\t\t\tsequenceName: sequence.seqName,\n\t\t\t\t\tsequenceOptions: sequence.seqOptions,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst { name, ...options } = sequence;\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'byDefault',\n\t\t\t\t\tsequenceName: name,\n\t\t\t\t\tsequenceOptions: options,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn this as any;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAA2B;AAC3B,sBAA6B;AAE7B,oBAAgC;AAEzB,MAAe,+BAEZ,8BAGR;AAAA,EACD,QAAiB,wBAAU,IAAY;AAAA,EAEvC,0BACC,UACsC;AACtC,QAAI,UAAU;AACb,cAAI,8BAAa,QAAQ,GAAG;AAC3B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,QAC3B;AAAA,MACD,OAAO;AACN,cAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc;AAAA,UACd,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,6BACC,UACyC;AACzC,QAAI,UAAU;AACb,cAAI,8BAAa,QAAQ,GAAG;AAC3B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,QAC3B;AAAA,MACD,OAAO;AACN,cAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc;AAAA,UACd,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;","names":[]}
@@ -1,7 +1,6 @@
1
1
  import type { ColumnBuilderBaseConfig, ColumnDataType, GeneratedIdentityConfig, IsIdentityByDefault } from "../../column-builder.cjs";
2
2
  import { entityKind } from "../../entity.cjs";
3
- import { PgSequence } from "../sequence.cjs";
4
- import type { PgSequenceOptions } from "../sequence.cjs";
3
+ import type { PgSequence, PgSequenceOptions } from "../sequence.cjs";
5
4
  import { PgColumnBuilder } from "./common.cjs";
6
5
  export declare abstract class PgIntColumnBaseBuilder<T extends ColumnBuilderBaseConfig<ColumnDataType, string>> extends PgColumnBuilder<T, {
7
6
  generatedIdentity: GeneratedIdentityConfig;
@@ -1,7 +1,6 @@
1
1
  import type { ColumnBuilderBaseConfig, ColumnDataType, GeneratedIdentityConfig, IsIdentityByDefault } from "../../column-builder.js";
2
2
  import { entityKind } from "../../entity.js";
3
- import { PgSequence } from "../sequence.js";
4
- import type { PgSequenceOptions } from "../sequence.js";
3
+ import type { PgSequence, PgSequenceOptions } from "../sequence.js";
5
4
  import { PgColumnBuilder } from "./common.js";
6
5
  export declare abstract class PgIntColumnBaseBuilder<T extends ColumnBuilderBaseConfig<ColumnDataType, string>> extends PgColumnBuilder<T, {
7
6
  generatedIdentity: GeneratedIdentityConfig;
@@ -1,11 +1,11 @@
1
- import { entityKind, is } from "../../entity.js";
2
- import { PgSequence } from "../sequence.js";
1
+ import { entityKind } from "../../entity.js";
2
+ import { isPgSequence } from "../sequence.js";
3
3
  import { PgColumnBuilder } from "./common.js";
4
4
  class PgIntColumnBaseBuilder extends PgColumnBuilder {
5
5
  static [entityKind] = "PgIntColumnBaseBuilder";
6
6
  generatedAlwaysAsIdentity(sequence) {
7
7
  if (sequence) {
8
- if (is(sequence, PgSequence)) {
8
+ if (isPgSequence(sequence)) {
9
9
  this.config.generatedIdentity = {
10
10
  type: "always",
11
11
  sequenceName: sequence.seqName,
@@ -24,7 +24,7 @@ class PgIntColumnBaseBuilder extends PgColumnBuilder {
24
24
  }
25
25
  generatedByDefaultAsIdentity(sequence) {
26
26
  if (sequence) {
27
- if (is(sequence, PgSequence)) {
27
+ if (isPgSequence(sequence)) {
28
28
  this.config.generatedIdentity = {
29
29
  type: "byDefault",
30
30
  sequenceName: sequence.seqName,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/pg-core/columns/int.common.ts"],"sourcesContent":["import type {\n\tColumnBuilderBaseConfig,\n\tColumnDataType,\n\tGeneratedIdentityConfig,\n\tIsIdentityByDefault,\n} from '~/column-builder.ts';\nimport { entityKind, is } from '~/entity.ts';\nimport { PgSequence } from '../sequence.ts';\nimport type { PgSequenceOptions } from '../sequence.ts';\nimport { PgColumnBuilder } from './common.ts';\n\nexport abstract class PgIntColumnBaseBuilder<\n\tT extends ColumnBuilderBaseConfig<ColumnDataType, string>,\n> extends PgColumnBuilder<\n\tT,\n\t{ generatedIdentity: GeneratedIdentityConfig }\n> {\n\tstatic readonly [entityKind]: string = 'PgIntColumnBaseBuilder';\n\n\tgeneratedAlwaysAsIdentity(\n\t\tsequence?: PgSequenceOptions & { name?: string } | PgSequence,\n\t): IsIdentityByDefault<this, 'always'> {\n\t\tif (sequence) {\n\t\t\tif (is(sequence, PgSequence)) {\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'always',\n\t\t\t\t\tsequenceName: sequence.seqName,\n\t\t\t\t\tsequenceOptions: sequence.seqOptions,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst { name, ...options } = sequence;\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'always',\n\t\t\t\t\tsequenceName: name,\n\t\t\t\t\tsequenceOptions: options,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn this as any;\n\t}\n\n\tgeneratedByDefaultAsIdentity(\n\t\tsequence?: PgSequenceOptions & { name?: string } | PgSequence,\n\t): IsIdentityByDefault<this, 'byDefault'> {\n\t\tif (sequence) {\n\t\t\tif (is(sequence, PgSequence)) {\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'byDefault',\n\t\t\t\t\tsequenceName: sequence.seqName,\n\t\t\t\t\tsequenceOptions: sequence.seqOptions,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst { name, ...options } = sequence;\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'byDefault',\n\t\t\t\t\tsequenceName: name,\n\t\t\t\t\tsequenceOptions: options,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn this as any;\n\t}\n}\n"],"mappings":"AAMA,SAAS,YAAY,UAAU;AAC/B,SAAS,kBAAkB;AAE3B,SAAS,uBAAuB;AAEzB,MAAe,+BAEZ,gBAGR;AAAA,EACD,QAAiB,UAAU,IAAY;AAAA,EAEvC,0BACC,UACsC;AACtC,QAAI,UAAU;AACb,UAAI,GAAG,UAAU,UAAU,GAAG;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,QAC3B;AAAA,MACD,OAAO;AACN,cAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc;AAAA,UACd,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,6BACC,UACyC;AACzC,QAAI,UAAU;AACb,UAAI,GAAG,UAAU,UAAU,GAAG;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,QAC3B;AAAA,MACD,OAAO;AACN,cAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc;AAAA,UACd,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/pg-core/columns/int.common.ts"],"sourcesContent":["import type {\n\tColumnBuilderBaseConfig,\n\tColumnDataType,\n\tGeneratedIdentityConfig,\n\tIsIdentityByDefault,\n} from '~/column-builder.ts';\nimport { entityKind } from '~/entity.ts';\nimport { isPgSequence } from '../sequence.ts';\nimport type { PgSequence, PgSequenceOptions } from '../sequence.ts';\nimport { PgColumnBuilder } from './common.ts';\n\nexport abstract class PgIntColumnBaseBuilder<\n\tT extends ColumnBuilderBaseConfig<ColumnDataType, string>,\n> extends PgColumnBuilder<\n\tT,\n\t{ generatedIdentity: GeneratedIdentityConfig }\n> {\n\tstatic readonly [entityKind]: string = 'PgIntColumnBaseBuilder';\n\n\tgeneratedAlwaysAsIdentity(\n\t\tsequence?: PgSequenceOptions & { name?: string } | PgSequence,\n\t): IsIdentityByDefault<this, 'always'> {\n\t\tif (sequence) {\n\t\t\tif (isPgSequence(sequence)) {\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'always',\n\t\t\t\t\tsequenceName: sequence.seqName,\n\t\t\t\t\tsequenceOptions: sequence.seqOptions,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst { name, ...options } = sequence;\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'always',\n\t\t\t\t\tsequenceName: name,\n\t\t\t\t\tsequenceOptions: options,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn this as any;\n\t}\n\n\tgeneratedByDefaultAsIdentity(\n\t\tsequence?: PgSequenceOptions & { name?: string } | PgSequence,\n\t): IsIdentityByDefault<this, 'byDefault'> {\n\t\tif (sequence) {\n\t\t\tif (isPgSequence(sequence)) {\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'byDefault',\n\t\t\t\t\tsequenceName: sequence.seqName,\n\t\t\t\t\tsequenceOptions: sequence.seqOptions,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst { name, ...options } = sequence;\n\t\t\t\tthis.config.generatedIdentity = {\n\t\t\t\t\ttype: 'byDefault',\n\t\t\t\t\tsequenceName: name,\n\t\t\t\t\tsequenceOptions: options,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn this as any;\n\t}\n}\n"],"mappings":"AAMA,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAE7B,SAAS,uBAAuB;AAEzB,MAAe,+BAEZ,gBAGR;AAAA,EACD,QAAiB,UAAU,IAAY;AAAA,EAEvC,0BACC,UACsC;AACtC,QAAI,UAAU;AACb,UAAI,aAAa,QAAQ,GAAG;AAC3B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,QAC3B;AAAA,MACD,OAAO;AACN,cAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc;AAAA,UACd,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,6BACC,UACyC;AACzC,QAAI,UAAU;AACb,UAAI,aAAa,QAAQ,GAAG;AAC3B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,QAC3B;AAAA,MACD,OAAO;AACN,cAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,aAAK,OAAO,oBAAoB;AAAA,UAC/B,MAAM;AAAA,UACN,cAAc;AAAA,UACd,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;","names":[]}
@@ -18,19 +18,12 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var sequence_exports = {};
20
20
  __export(sequence_exports, {
21
- PgSequence: () => PgSequence,
22
21
  isPgSequence: () => isPgSequence,
23
22
  pgSequence: () => pgSequence,
24
23
  pgSequenceWithSchema: () => pgSequenceWithSchema
25
24
  });
26
25
  module.exports = __toCommonJS(sequence_exports);
27
- var import_entity = require("../entity.cjs");
28
- class PgSequence {
29
- static [import_entity.entityKind] = "PgSequence";
30
- seqName;
31
- seqOptions;
32
- schema;
33
- }
26
+ const isPgSequenceSym = Symbol.for("drizzle:isPgSequence");
34
27
  function pgSequence(name, options) {
35
28
  return pgSequenceWithSchema(name, options, void 0);
36
29
  }
@@ -45,11 +38,10 @@ function pgSequenceWithSchema(name, options, schema) {
45
38
  return sequenceInstance;
46
39
  }
47
40
  function isPgSequence(obj) {
48
- return (0, import_entity.is)(obj, PgSequence);
41
+ return !!obj && typeof obj === "function" && isPgSequenceSym in obj && obj[isPgSequenceSym] === true;
49
42
  }
50
43
  // Annotate the CommonJS export names for ESM import in node:
51
44
  0 && (module.exports = {
52
- PgSequence,
53
45
  isPgSequence,
54
46
  pgSequence,
55
47
  pgSequenceWithSchema
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/pg-core/sequence.ts"],"sourcesContent":["import { entityKind, is } from '~/entity.ts';\n\nexport type PgSequenceOptions = {\n\tincrement?: number;\n\tminValue?: number;\n\tmaxValue?: number;\n\tstartWith?: number;\n\tcache?: number;\n\tcycle?: boolean;\n};\n\nexport class PgSequence {\n\tstatic readonly [entityKind]: string = 'PgSequence';\n\n\treadonly seqName: string | undefined;\n\treadonly seqOptions: PgSequenceOptions | undefined;\n\treadonly schema: string | undefined;\n}\n\nexport function pgSequence(\n\tname: string,\n\toptions: PgSequenceOptions,\n): PgSequence {\n\treturn pgSequenceWithSchema(name, options, undefined);\n}\n\n/** @internal */\nexport function pgSequenceWithSchema(\n\tname: string,\n\toptions: PgSequenceOptions,\n\tschema?: string,\n): PgSequence {\n\tconst sequenceInstance: PgSequence = Object.assign(\n\t\t{\n\t\t\tname,\n\t\t\tseqOptions: options,\n\t\t\tschema,\n\t\t} as const,\n\t);\n\n\treturn sequenceInstance;\n}\n\nexport function isPgSequence(obj: unknown): obj is PgSequence {\n\treturn is(obj, PgSequence);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA+B;AAWxB,MAAM,WAAW;AAAA,EACvB,QAAiB,wBAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAAA,EACA;AACV;AAEO,SAAS,WACf,MACA,SACa;AACb,SAAO,qBAAqB,MAAM,SAAS,MAAS;AACrD;AAGO,SAAS,qBACf,MACA,SACA,QACa;AACb,QAAM,mBAA+B,OAAO;AAAA,IAC3C;AAAA,MACC;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AACR;AAEO,SAAS,aAAa,KAAiC;AAC7D,aAAO,kBAAG,KAAK,UAAU;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../src/pg-core/sequence.ts"],"sourcesContent":["export type PgSequenceOptions = {\n\tincrement?: number;\n\tminValue?: number;\n\tmaxValue?: number;\n\tstartWith?: number;\n\tcache?: number;\n\tcycle?: boolean;\n};\n\nconst isPgSequenceSym = Symbol.for('drizzle:isPgSequence');\nexport interface PgSequence {\n\treadonly seqName: string | undefined;\n\treadonly seqOptions: PgSequenceOptions | undefined;\n\treadonly schema: string | undefined;\n\n\t/** @internal */\n\t[isPgSequenceSym]: true;\n}\n\nexport function pgSequence(\n\tname: string,\n\toptions: PgSequenceOptions,\n): PgSequence {\n\treturn pgSequenceWithSchema(name, options, undefined);\n}\n\n/** @internal */\nexport function pgSequenceWithSchema(\n\tname: string,\n\toptions: PgSequenceOptions,\n\tschema?: string,\n): PgSequence {\n\tconst sequenceInstance: PgSequence = Object.assign(\n\t\t{\n\t\t\tname,\n\t\t\tseqOptions: options,\n\t\t\tschema,\n\t\t} as const,\n\t);\n\n\treturn sequenceInstance;\n}\n\nexport function isPgSequence(obj: unknown): obj is PgSequence {\n\treturn !!obj && typeof obj === 'function' && isPgSequenceSym in obj && obj[isPgSequenceSym] === true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAM,kBAAkB,OAAO,IAAI,sBAAsB;AAUlD,SAAS,WACf,MACA,SACa;AACb,SAAO,qBAAqB,MAAM,SAAS,MAAS;AACrD;AAGO,SAAS,qBACf,MACA,SACA,QACa;AACb,QAAM,mBAA+B,OAAO;AAAA,IAC3C;AAAA,MACC;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AACR;AAEO,SAAS,aAAa,KAAiC;AAC7D,SAAO,CAAC,CAAC,OAAO,OAAO,QAAQ,cAAc,mBAAmB,OAAO,IAAI,eAAe,MAAM;AACjG;","names":[]}
@@ -1,4 +1,3 @@
1
- import { entityKind } from "../entity.cjs";
2
1
  export type PgSequenceOptions = {
3
2
  increment?: number;
4
3
  minValue?: number;
@@ -7,8 +6,7 @@ export type PgSequenceOptions = {
7
6
  cache?: number;
8
7
  cycle?: boolean;
9
8
  };
10
- export declare class PgSequence {
11
- static readonly [entityKind]: string;
9
+ export interface PgSequence {
12
10
  readonly seqName: string | undefined;
13
11
  readonly seqOptions: PgSequenceOptions | undefined;
14
12
  readonly schema: string | undefined;
@@ -1,4 +1,3 @@
1
- import { entityKind } from "../entity.js";
2
1
  export type PgSequenceOptions = {
3
2
  increment?: number;
4
3
  minValue?: number;
@@ -7,8 +6,7 @@ export type PgSequenceOptions = {
7
6
  cache?: number;
8
7
  cycle?: boolean;
9
8
  };
10
- export declare class PgSequence {
11
- static readonly [entityKind]: string;
9
+ export interface PgSequence {
12
10
  readonly seqName: string | undefined;
13
11
  readonly seqOptions: PgSequenceOptions | undefined;
14
12
  readonly schema: string | undefined;
@@ -1,10 +1,4 @@
1
- import { entityKind, is } from "../entity.js";
2
- class PgSequence {
3
- static [entityKind] = "PgSequence";
4
- seqName;
5
- seqOptions;
6
- schema;
7
- }
1
+ const isPgSequenceSym = Symbol.for("drizzle:isPgSequence");
8
2
  function pgSequence(name, options) {
9
3
  return pgSequenceWithSchema(name, options, void 0);
10
4
  }
@@ -19,10 +13,9 @@ function pgSequenceWithSchema(name, options, schema) {
19
13
  return sequenceInstance;
20
14
  }
21
15
  function isPgSequence(obj) {
22
- return is(obj, PgSequence);
16
+ return !!obj && typeof obj === "function" && isPgSequenceSym in obj && obj[isPgSequenceSym] === true;
23
17
  }
24
18
  export {
25
- PgSequence,
26
19
  isPgSequence,
27
20
  pgSequence,
28
21
  pgSequenceWithSchema
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/pg-core/sequence.ts"],"sourcesContent":["import { entityKind, is } from '~/entity.ts';\n\nexport type PgSequenceOptions = {\n\tincrement?: number;\n\tminValue?: number;\n\tmaxValue?: number;\n\tstartWith?: number;\n\tcache?: number;\n\tcycle?: boolean;\n};\n\nexport class PgSequence {\n\tstatic readonly [entityKind]: string = 'PgSequence';\n\n\treadonly seqName: string | undefined;\n\treadonly seqOptions: PgSequenceOptions | undefined;\n\treadonly schema: string | undefined;\n}\n\nexport function pgSequence(\n\tname: string,\n\toptions: PgSequenceOptions,\n): PgSequence {\n\treturn pgSequenceWithSchema(name, options, undefined);\n}\n\n/** @internal */\nexport function pgSequenceWithSchema(\n\tname: string,\n\toptions: PgSequenceOptions,\n\tschema?: string,\n): PgSequence {\n\tconst sequenceInstance: PgSequence = Object.assign(\n\t\t{\n\t\t\tname,\n\t\t\tseqOptions: options,\n\t\t\tschema,\n\t\t} as const,\n\t);\n\n\treturn sequenceInstance;\n}\n\nexport function isPgSequence(obj: unknown): obj is PgSequence {\n\treturn is(obj, PgSequence);\n}\n"],"mappings":"AAAA,SAAS,YAAY,UAAU;AAWxB,MAAM,WAAW;AAAA,EACvB,QAAiB,UAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAAA,EACA;AACV;AAEO,SAAS,WACf,MACA,SACa;AACb,SAAO,qBAAqB,MAAM,SAAS,MAAS;AACrD;AAGO,SAAS,qBACf,MACA,SACA,QACa;AACb,QAAM,mBAA+B,OAAO;AAAA,IAC3C;AAAA,MACC;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AACR;AAEO,SAAS,aAAa,KAAiC;AAC7D,SAAO,GAAG,KAAK,UAAU;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../src/pg-core/sequence.ts"],"sourcesContent":["export type PgSequenceOptions = {\n\tincrement?: number;\n\tminValue?: number;\n\tmaxValue?: number;\n\tstartWith?: number;\n\tcache?: number;\n\tcycle?: boolean;\n};\n\nconst isPgSequenceSym = Symbol.for('drizzle:isPgSequence');\nexport interface PgSequence {\n\treadonly seqName: string | undefined;\n\treadonly seqOptions: PgSequenceOptions | undefined;\n\treadonly schema: string | undefined;\n\n\t/** @internal */\n\t[isPgSequenceSym]: true;\n}\n\nexport function pgSequence(\n\tname: string,\n\toptions: PgSequenceOptions,\n): PgSequence {\n\treturn pgSequenceWithSchema(name, options, undefined);\n}\n\n/** @internal */\nexport function pgSequenceWithSchema(\n\tname: string,\n\toptions: PgSequenceOptions,\n\tschema?: string,\n): PgSequence {\n\tconst sequenceInstance: PgSequence = Object.assign(\n\t\t{\n\t\t\tname,\n\t\t\tseqOptions: options,\n\t\t\tschema,\n\t\t} as const,\n\t);\n\n\treturn sequenceInstance;\n}\n\nexport function isPgSequence(obj: unknown): obj is PgSequence {\n\treturn !!obj && typeof obj === 'function' && isPgSequenceSym in obj && obj[isPgSequenceSym] === true;\n}\n"],"mappings":"AASA,MAAM,kBAAkB,OAAO,IAAI,sBAAsB;AAUlD,SAAS,WACf,MACA,SACa;AACb,SAAO,qBAAqB,MAAM,SAAS,MAAS;AACrD;AAGO,SAAS,qBACf,MACA,SACA,QACa;AACb,QAAM,mBAA+B,OAAO;AAAA,IAC3C;AAAA,MACC;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AACR;AAEO,SAAS,aAAa,KAAiC;AAC7D,SAAO,CAAC,CAAC,OAAO,OAAO,QAAQ,cAAc,mBAAmB,OAAO,IAAI,eAAe,MAAM;AACjG;","names":[]}
package/version.cjs CHANGED
@@ -26,7 +26,7 @@ __export(version_exports, {
26
26
  module.exports = __toCommonJS(version_exports);
27
27
 
28
28
  // package.json
29
- var version = "0.32.0-4ed01aa";
29
+ var version = "0.32.0-857ba54";
30
30
 
31
31
  // src/version.ts
32
32
  var compatibilityVersion = 7;
package/version.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- var version = "0.32.0-4ed01aa";
1
+ var version = "0.32.0-857ba54";
2
2
 
3
3
  declare const compatibilityVersion = 7;
4
4
 
package/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- var version = "0.32.0-4ed01aa";
1
+ var version = "0.32.0-857ba54";
2
2
 
3
3
  declare const compatibilityVersion = 7;
4
4
 
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.32.0-4ed01aa";
2
+ var version = "0.32.0-857ba54";
3
3
 
4
4
  // src/version.ts
5
5
  var compatibilityVersion = 7;