drizzle-kit 1.0.0-beta.1-69a2ca0 → 1.0.0-beta.1-a7dd17f

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 (4) hide show
  1. package/api.js +23 -17
  2. package/api.mjs +23 -17
  3. package/bin.cjs +1 -1
  4. package/package.json +1 -1
package/api.js CHANGED
@@ -24516,6 +24516,7 @@ function isConfig(data) {
24516
24516
  if (Object.keys(data).length === 0) return true;
24517
24517
  return false;
24518
24518
  }
24519
+ var textDecoder;
24519
24520
  var init_utils2 = __esm({
24520
24521
  "../drizzle-orm/dist/utils.js"() {
24521
24522
  "use strict";
@@ -24525,6 +24526,7 @@ var init_utils2 = __esm({
24525
24526
  init_subquery();
24526
24527
  init_table();
24527
24528
  init_view_common();
24529
+ textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder();
24528
24530
  }
24529
24531
  });
24530
24532
 
@@ -24662,7 +24664,8 @@ __export(dist_exports, {
24662
24664
  relationsOrderToSQL: () => relationsOrderToSQL,
24663
24665
  sql: () => sql,
24664
24666
  sum: () => sum,
24665
- sumDistinct: () => sumDistinct
24667
+ sumDistinct: () => sumDistinct,
24668
+ textDecoder: () => textDecoder
24666
24669
  });
24667
24670
  var init_dist = __esm({
24668
24671
  "../drizzle-orm/dist/index.js"() {
@@ -32825,6 +32828,15 @@ var init_common3 = __esm({
32825
32828
  });
32826
32829
 
32827
32830
  // ../drizzle-orm/dist/sqlite-core/columns/blob.js
32831
+ function hexToText(hexString) {
32832
+ let result = "";
32833
+ for (let i = 0; i < hexString.length; i += 2) {
32834
+ const hexPair = hexString.substring(i, i + 2);
32835
+ const decimalValue = parseInt(hexPair, 16);
32836
+ result += String.fromCharCode(decimalValue);
32837
+ }
32838
+ return result;
32839
+ }
32828
32840
  function blob(a, b) {
32829
32841
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32830
32842
  if (config?.mode === "json") {
@@ -32857,17 +32869,14 @@ var init_blob = __esm({
32857
32869
  return "blob";
32858
32870
  }
32859
32871
  mapFromDriverValue(value) {
32860
- if (Buffer.isBuffer(value)) {
32861
- return BigInt(value.toString());
32862
- }
32863
32872
  if (typeof value === "string") {
32864
- return BigInt(Buffer.from(value, "hex").toString());
32873
+ return BigInt(hexToText(value));
32865
32874
  }
32866
- if (value instanceof ArrayBuffer) {
32867
- const decoder = new TextDecoder();
32868
- return BigInt(decoder.decode(value));
32875
+ if (typeof Buffer !== "undefined" && Buffer.from) {
32876
+ const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value);
32877
+ return BigInt(buf.toString("utf8"));
32869
32878
  }
32870
- return BigInt(String.fromCodePoint(...value));
32879
+ return BigInt(textDecoder.decode(value));
32871
32880
  }
32872
32881
  mapToDriverValue(value) {
32873
32882
  return Buffer.from(value.toString());
@@ -32892,17 +32901,14 @@ var init_blob = __esm({
32892
32901
  return "blob";
32893
32902
  }
32894
32903
  mapFromDriverValue(value) {
32895
- if (Buffer.isBuffer(value)) {
32896
- return JSON.parse(value.toString());
32897
- }
32898
32904
  if (typeof value === "string") {
32899
- return JSON.parse(Buffer.from(value, "hex").toString());
32905
+ return JSON.parse(hexToText(value));
32900
32906
  }
32901
- if (value instanceof ArrayBuffer) {
32902
- const decoder = new TextDecoder();
32903
- return JSON.parse(decoder.decode(value));
32907
+ if (typeof Buffer !== "undefined" && Buffer.from) {
32908
+ const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value);
32909
+ return JSON.parse(buf.toString("utf8"));
32904
32910
  }
32905
- return JSON.parse(String.fromCodePoint(...value));
32911
+ return JSON.parse(textDecoder.decode(value));
32906
32912
  }
32907
32913
  mapToDriverValue(value) {
32908
32914
  return Buffer.from(JSON.stringify(value));
package/api.mjs CHANGED
@@ -24521,6 +24521,7 @@ function isConfig(data) {
24521
24521
  if (Object.keys(data).length === 0) return true;
24522
24522
  return false;
24523
24523
  }
24524
+ var textDecoder;
24524
24525
  var init_utils2 = __esm({
24525
24526
  "../drizzle-orm/dist/utils.js"() {
24526
24527
  "use strict";
@@ -24530,6 +24531,7 @@ var init_utils2 = __esm({
24530
24531
  init_subquery();
24531
24532
  init_table();
24532
24533
  init_view_common();
24534
+ textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder();
24533
24535
  }
24534
24536
  });
24535
24537
 
@@ -24667,7 +24669,8 @@ __export(dist_exports, {
24667
24669
  relationsOrderToSQL: () => relationsOrderToSQL,
24668
24670
  sql: () => sql,
24669
24671
  sum: () => sum,
24670
- sumDistinct: () => sumDistinct
24672
+ sumDistinct: () => sumDistinct,
24673
+ textDecoder: () => textDecoder
24671
24674
  });
24672
24675
  var init_dist = __esm({
24673
24676
  "../drizzle-orm/dist/index.js"() {
@@ -32830,6 +32833,15 @@ var init_common3 = __esm({
32830
32833
  });
32831
32834
 
32832
32835
  // ../drizzle-orm/dist/sqlite-core/columns/blob.js
32836
+ function hexToText(hexString) {
32837
+ let result = "";
32838
+ for (let i = 0; i < hexString.length; i += 2) {
32839
+ const hexPair = hexString.substring(i, i + 2);
32840
+ const decimalValue = parseInt(hexPair, 16);
32841
+ result += String.fromCharCode(decimalValue);
32842
+ }
32843
+ return result;
32844
+ }
32833
32845
  function blob(a, b) {
32834
32846
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32835
32847
  if (config?.mode === "json") {
@@ -32862,17 +32874,14 @@ var init_blob = __esm({
32862
32874
  return "blob";
32863
32875
  }
32864
32876
  mapFromDriverValue(value) {
32865
- if (Buffer.isBuffer(value)) {
32866
- return BigInt(value.toString());
32867
- }
32868
32877
  if (typeof value === "string") {
32869
- return BigInt(Buffer.from(value, "hex").toString());
32878
+ return BigInt(hexToText(value));
32870
32879
  }
32871
- if (value instanceof ArrayBuffer) {
32872
- const decoder = new TextDecoder();
32873
- return BigInt(decoder.decode(value));
32880
+ if (typeof Buffer !== "undefined" && Buffer.from) {
32881
+ const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value);
32882
+ return BigInt(buf.toString("utf8"));
32874
32883
  }
32875
- return BigInt(String.fromCodePoint(...value));
32884
+ return BigInt(textDecoder.decode(value));
32876
32885
  }
32877
32886
  mapToDriverValue(value) {
32878
32887
  return Buffer.from(value.toString());
@@ -32897,17 +32906,14 @@ var init_blob = __esm({
32897
32906
  return "blob";
32898
32907
  }
32899
32908
  mapFromDriverValue(value) {
32900
- if (Buffer.isBuffer(value)) {
32901
- return JSON.parse(value.toString());
32902
- }
32903
32909
  if (typeof value === "string") {
32904
- return JSON.parse(Buffer.from(value, "hex").toString());
32910
+ return JSON.parse(hexToText(value));
32905
32911
  }
32906
- if (value instanceof ArrayBuffer) {
32907
- const decoder = new TextDecoder();
32908
- return JSON.parse(decoder.decode(value));
32912
+ if (typeof Buffer !== "undefined" && Buffer.from) {
32913
+ const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value);
32914
+ return JSON.parse(buf.toString("utf8"));
32909
32915
  }
32910
- return JSON.parse(String.fromCodePoint(...value));
32916
+ return JSON.parse(textDecoder.decode(value));
32911
32917
  }
32912
32918
  mapToDriverValue(value) {
32913
32919
  return Buffer.from(JSON.stringify(value));
package/bin.cjs CHANGED
@@ -93920,7 +93920,7 @@ init_utils5();
93920
93920
  var version2 = async () => {
93921
93921
  const { npmVersion } = await ormCoreVersions();
93922
93922
  const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
93923
- const envVersion = "1.0.0-beta.1-69a2ca0";
93923
+ const envVersion = "1.0.0-beta.1-a7dd17f";
93924
93924
  const kitVersion = envVersion ? `v${envVersion}` : "--";
93925
93925
  const versions = `drizzle-kit: ${kitVersion}
93926
93926
  ${ormVersion}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "1.0.0-beta.1-69a2ca0",
3
+ "version": "1.0.0-beta.1-a7dd17f",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",