react-native-nitro-sqlite 9.2.2 → 9.4.0

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 (118) hide show
  1. package/android/CMakeLists.txt +1 -1
  2. package/cpp/NitroSQLiteException.hpp +1 -2
  3. package/cpp/{specs → hybridObjects}/HybridNitroSQLite.cpp +64 -16
  4. package/cpp/{specs → hybridObjects}/HybridNitroSQLite.hpp +6 -6
  5. package/cpp/hybridObjects/HybridNitroSQLiteQueryResult.cpp +93 -0
  6. package/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp +47 -0
  7. package/cpp/operations.cpp +16 -12
  8. package/cpp/operations.hpp +3 -1
  9. package/cpp/sqliteExecuteBatch.cpp +2 -2
  10. package/cpp/sqliteExecuteBatch.hpp +2 -2
  11. package/cpp/types.hpp +4 -14
  12. package/ios/NitroSQLite.xcodeproj/project.pbxproj +2 -2
  13. package/lib/commonjs/index.js +0 -25
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/operations/execute.js +19 -32
  16. package/lib/commonjs/operations/execute.js.map +1 -1
  17. package/lib/commonjs/operations/executeBatch.js +2 -19
  18. package/lib/commonjs/operations/executeBatch.js.map +1 -1
  19. package/lib/commonjs/specs/{NativeQueryResult.nitro.js → NitroSQLiteQueryResult.nitro.js} +1 -1
  20. package/lib/commonjs/specs/NitroSQLiteQueryResult.nitro.js.map +1 -0
  21. package/lib/commonjs/types.js +1 -8
  22. package/lib/commonjs/types.js.map +1 -1
  23. package/lib/module/index.js +0 -1
  24. package/lib/module/index.js.map +1 -1
  25. package/lib/module/operations/execute.js +19 -33
  26. package/lib/module/operations/execute.js.map +1 -1
  27. package/lib/module/operations/executeBatch.js +2 -19
  28. package/lib/module/operations/executeBatch.js.map +1 -1
  29. package/lib/module/specs/NitroSQLiteQueryResult.nitro.js +4 -0
  30. package/lib/module/specs/NitroSQLiteQueryResult.nitro.js.map +1 -0
  31. package/lib/module/types.js +0 -12
  32. package/lib/module/types.js.map +1 -1
  33. package/lib/typescript/commonjs/index.d.ts +0 -1
  34. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/operations/execute.d.ts +1 -1
  36. package/lib/typescript/commonjs/operations/execute.d.ts.map +1 -1
  37. package/lib/typescript/commonjs/operations/executeBatch.d.ts +1 -1
  38. package/lib/typescript/commonjs/operations/executeBatch.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/operations/transaction.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/specs/NitroSQLite.nitro.d.ts +6 -6
  41. package/lib/typescript/commonjs/specs/NitroSQLite.nitro.d.ts.map +1 -1
  42. package/lib/typescript/{module/specs/NativeQueryResult.nitro.d.ts → commonjs/specs/NitroSQLiteQueryResult.nitro.d.ts} +7 -13
  43. package/lib/typescript/commonjs/specs/NitroSQLiteQueryResult.nitro.d.ts.map +1 -0
  44. package/lib/typescript/commonjs/typeORM.d.ts +1 -1
  45. package/lib/typescript/commonjs/typeORM.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/types.d.ts +21 -37
  47. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  48. package/lib/typescript/module/index.d.ts +0 -1
  49. package/lib/typescript/module/index.d.ts.map +1 -1
  50. package/lib/typescript/module/operations/execute.d.ts +1 -1
  51. package/lib/typescript/module/operations/execute.d.ts.map +1 -1
  52. package/lib/typescript/module/operations/executeBatch.d.ts +1 -1
  53. package/lib/typescript/module/operations/executeBatch.d.ts.map +1 -1
  54. package/lib/typescript/module/operations/transaction.d.ts.map +1 -1
  55. package/lib/typescript/module/specs/NitroSQLite.nitro.d.ts +6 -6
  56. package/lib/typescript/module/specs/NitroSQLite.nitro.d.ts.map +1 -1
  57. package/lib/typescript/{commonjs/specs/NativeQueryResult.nitro.d.ts → module/specs/NitroSQLiteQueryResult.nitro.d.ts} +7 -13
  58. package/lib/typescript/module/specs/NitroSQLiteQueryResult.nitro.d.ts.map +1 -0
  59. package/lib/typescript/module/typeORM.d.ts +1 -1
  60. package/lib/typescript/module/typeORM.d.ts.map +1 -1
  61. package/lib/typescript/module/types.d.ts +21 -37
  62. package/lib/typescript/module/types.d.ts.map +1 -1
  63. package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake +9 -6
  64. package/nitrogen/generated/android/RNNitroSQLite+autolinking.gradle +1 -1
  65. package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp +2 -4
  66. package/nitrogen/generated/android/RNNitroSQLiteOnLoad.hpp +1 -1
  67. package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.cpp +14 -1
  68. package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.hpp +4 -1
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoadSpec.kt +8 -3
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/RNNitroSQLiteOnLoad.kt +1 -1
  71. package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb +2 -2
  72. package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.cpp +1 -1
  73. package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp +1 -1
  74. package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Umbrella.hpp +1 -1
  75. package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.mm +1 -1
  76. package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.swift +5 -1
  77. package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp +92 -0
  78. package/nitrogen/generated/shared/c++/BatchQueryResult.hpp +25 -11
  79. package/nitrogen/generated/shared/c++/ColumnType.hpp +5 -7
  80. package/nitrogen/generated/shared/c++/FileLoadResult.hpp +28 -14
  81. package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.cpp +1 -1
  82. package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.hpp +1 -1
  83. package/nitrogen/generated/shared/c++/HybridNitroSQLiteQueryResultSpec.cpp +24 -0
  84. package/nitrogen/generated/shared/c++/HybridNitroSQLiteQueryResultSpec.hpp +73 -0
  85. package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp +1 -1
  86. package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp +12 -16
  87. package/nitrogen/generated/shared/c++/NitroSQLiteQueryColumnMetadata.hpp +93 -0
  88. package/package.json +5 -5
  89. package/src/index.ts +0 -6
  90. package/src/operations/execute.ts +23 -58
  91. package/src/operations/executeBatch.ts +3 -41
  92. package/src/operations/session.ts +1 -1
  93. package/src/operations/transaction.ts +1 -1
  94. package/src/specs/NitroSQLite.nitro.ts +9 -12
  95. package/src/specs/{NativeQueryResult.nitro.ts → NitroSQLiteQueryResult.nitro.ts} +15 -17
  96. package/src/typeORM.ts +1 -1
  97. package/src/types.ts +28 -45
  98. package/cpp/specs/HybridNativeQueryResult.cpp +0 -21
  99. package/cpp/specs/HybridNativeQueryResult.hpp +0 -27
  100. package/lib/commonjs/nullHandling.js +0 -33
  101. package/lib/commonjs/nullHandling.js.map +0 -1
  102. package/lib/commonjs/specs/NativeQueryResult.nitro.js.map +0 -1
  103. package/lib/module/nullHandling.js +0 -25
  104. package/lib/module/nullHandling.js.map +0 -1
  105. package/lib/module/specs/NativeQueryResult.nitro.js +0 -4
  106. package/lib/module/specs/NativeQueryResult.nitro.js.map +0 -1
  107. package/lib/typescript/commonjs/nullHandling.d.ts +0 -8
  108. package/lib/typescript/commonjs/nullHandling.d.ts.map +0 -1
  109. package/lib/typescript/commonjs/specs/NativeQueryResult.nitro.d.ts.map +0 -1
  110. package/lib/typescript/module/nullHandling.d.ts +0 -8
  111. package/lib/typescript/module/nullHandling.d.ts.map +0 -1
  112. package/lib/typescript/module/specs/NativeQueryResult.nitro.d.ts.map +0 -1
  113. package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp +0 -24
  114. package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp +0 -77
  115. package/nitrogen/generated/shared/c++/NativeBatchQueryCommand.hpp +0 -81
  116. package/nitrogen/generated/shared/c++/SQLiteNullValue.hpp +0 -69
  117. package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp +0 -79
  118. package/src/nullHandling.ts +0 -35
@@ -5,43 +5,26 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.executeBatch = executeBatch;
7
7
  exports.executeBatchAsync = executeBatchAsync;
8
- var _nullHandling = require("../nullHandling.js");
9
8
  var _nitro = require("../nitro.js");
10
9
  var _DatabaseQueue = require("../DatabaseQueue.js");
11
10
  var _NitroSQLiteError = _interopRequireDefault(require("../NitroSQLiteError.js"));
12
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
12
  function executeBatch(dbName, commands) {
14
13
  (0, _DatabaseQueue.throwIfDatabaseIsNotOpen)(dbName);
15
- const transformedCommands = (0, _nullHandling.isSimpleNullHandlingEnabled)() ? toNativeBatchQueryCommands(commands) : commands;
16
14
  try {
17
- return (0, _DatabaseQueue.startOperationSync)(dbName, () => _nitro.HybridNitroSQLite.executeBatch(dbName, transformedCommands));
15
+ return (0, _DatabaseQueue.startOperationSync)(dbName, () => _nitro.HybridNitroSQLite.executeBatch(dbName, commands));
18
16
  } catch (error) {
19
17
  throw _NitroSQLiteError.default.fromError(error);
20
18
  }
21
19
  }
22
20
  async function executeBatchAsync(dbName, commands) {
23
21
  (0, _DatabaseQueue.throwIfDatabaseIsNotOpen)(dbName);
24
- const transformedCommands = (0, _nullHandling.isSimpleNullHandlingEnabled)() ? toNativeBatchQueryCommands(commands) : commands;
25
22
  return (0, _DatabaseQueue.queueOperationAsync)(dbName, async () => {
26
23
  try {
27
- return await _nitro.HybridNitroSQLite.executeBatchAsync(dbName, transformedCommands);
24
+ return await _nitro.HybridNitroSQLite.executeBatchAsync(dbName, commands);
28
25
  } catch (error) {
29
26
  throw _NitroSQLiteError.default.fromError(error);
30
27
  }
31
28
  });
32
29
  }
33
- function toNativeBatchQueryCommands(commands) {
34
- return commands.map(command => {
35
- const transformedParams = command.params?.map(param => {
36
- if (Array.isArray(param)) {
37
- return param.map(p => (0, _nullHandling.replaceWithNativeNullValue)(p));
38
- }
39
- return (0, _nullHandling.replaceWithNativeNullValue)(param);
40
- });
41
- return {
42
- query: command.query,
43
- params: transformedParams
44
- };
45
- });
46
- }
47
30
  //# sourceMappingURL=executeBatch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_nullHandling","require","_nitro","_DatabaseQueue","_NitroSQLiteError","_interopRequireDefault","e","__esModule","default","executeBatch","dbName","commands","throwIfDatabaseIsNotOpen","transformedCommands","isSimpleNullHandlingEnabled","toNativeBatchQueryCommands","startOperationSync","HybridNitroSQLite","error","NitroSQLiteError","fromError","executeBatchAsync","queueOperationAsync","map","command","transformedParams","params","param","Array","isArray","p","replaceWithNativeNullValue","query"],"sourceRoot":"../../../src","sources":["operations/executeBatch.ts"],"mappings":";;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAWA,IAAAG,iBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAkD,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3C,SAASG,YAAYA,CAC1BC,MAAc,EACdC,QAA6B,EACX;EAClB,IAAAC,uCAAwB,EAACF,MAAM,CAAC;EAEhC,MAAMG,mBAAmB,GAAG,IAAAC,yCAA2B,EAAC,CAAC,GACrDC,0BAA0B,CAACJ,QAAQ,CAAC,GACnCA,QAAsC;EAE3C,IAAI;IACF,OAAO,IAAAK,iCAAkB,EAACN,MAAM,EAAE,MAChCO,wBAAiB,CAACR,YAAY,CAACC,MAAM,EAAEG,mBAAmB,CAC5D,CAAC;EACH,CAAC,CAAC,OAAOK,KAAK,EAAE;IACd,MAAMC,yBAAgB,CAACC,SAAS,CAACF,KAAK,CAAC;EACzC;AACF;AAEO,eAAeG,iBAAiBA,CACrCX,MAAc,EACdC,QAA6B,EACF;EAC3B,IAAAC,uCAAwB,EAACF,MAAM,CAAC;EAEhC,MAAMG,mBAAmB,GAAG,IAAAC,yCAA2B,EAAC,CAAC,GACrDC,0BAA0B,CAACJ,QAAQ,CAAC,GACnCA,QAAsC;EAE3C,OAAO,IAAAW,kCAAmB,EAACZ,MAAM,EAAE,YAAY;IAC7C,IAAI;MACF,OAAO,MAAMO,wBAAiB,CAACI,iBAAiB,CAC9CX,MAAM,EACNG,mBACF,CAAC;IACH,CAAC,CAAC,OAAOK,KAAK,EAAE;MACd,MAAMC,yBAAgB,CAACC,SAAS,CAACF,KAAK,CAAC;IACzC;EACF,CAAC,CAAC;AACJ;AAEA,SAASH,0BAA0BA,CACjCJ,QAA6B,EACF;EAC3B,OAAOA,QAAQ,CAACY,GAAG,CAAEC,OAAO,IAAK;IAC/B,MAAMC,iBAAiB,GAAGD,OAAO,CAACE,MAAM,EAAEH,GAAG,CAAEI,KAAK,IAAK;MACvD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;QACxB,OAAOA,KAAK,CAACJ,GAAG,CAAEO,CAAC,IAAK,IAAAC,wCAA0B,EAACD,CAAC,CAAC,CAAC;MACxD;MACA,OAAO,IAAAC,wCAA0B,EAACJ,KAAK,CAAC;IAC1C,CAAC,CAAwD;IAEzD,OAAO;MACLK,KAAK,EAAER,OAAO,CAACQ,KAAK;MACpBN,MAAM,EAAED;IACV,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_nitro","require","_DatabaseQueue","_NitroSQLiteError","_interopRequireDefault","e","__esModule","default","executeBatch","dbName","commands","throwIfDatabaseIsNotOpen","startOperationSync","HybridNitroSQLite","error","NitroSQLiteError","fromError","executeBatchAsync","queueOperationAsync"],"sourceRoot":"../../../src","sources":["operations/executeBatch.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAKA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAkD,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG3C,SAASG,YAAYA,CAC1BC,MAAc,EACdC,QAA6B,EACX;EAClB,IAAAC,uCAAwB,EAACF,MAAM,CAAC;EAEhC,IAAI;IACF,OAAO,IAAAG,iCAAkB,EAACH,MAAM,EAAE,MAChCI,wBAAiB,CAACL,YAAY,CAACC,MAAM,EAAEC,QAAQ,CACjD,CAAC;EACH,CAAC,CAAC,OAAOI,KAAK,EAAE;IACd,MAAMC,yBAAgB,CAACC,SAAS,CAACF,KAAK,CAAC;EACzC;AACF;AAEO,eAAeG,iBAAiBA,CACrCR,MAAc,EACdC,QAA6B,EACF;EAC3B,IAAAC,uCAAwB,EAACF,MAAM,CAAC;EAEhC,OAAO,IAAAS,kCAAmB,EAACT,MAAM,EAAE,YAAY;IAC7C,IAAI;MACF,OAAO,MAAMI,wBAAiB,CAACI,iBAAiB,CAACR,MAAM,EAAEC,QAAQ,CAAC;IACpE,CAAC,CAAC,OAAOI,KAAK,EAAE;MACd,MAAMC,yBAAgB,CAACC,SAAS,CAACF,KAAK,CAAC;IACzC;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- //# sourceMappingURL=NativeQueryResult.nitro.js.map
6
+ //# sourceMappingURL=NitroSQLiteQueryResult.nitro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NitroSQLiteQueryResult.nitro.ts"],"mappings":"","ignoreList":[]}
@@ -12,20 +12,13 @@ let ColumnType = exports.ColumnType = /*#__PURE__*/function (ColumnType) {
12
12
  ColumnType[ColumnType["ARRAY_BUFFER"] = 4] = "ARRAY_BUFFER";
13
13
  ColumnType[ColumnType["NULL_VALUE"] = 5] = "NULL_VALUE";
14
14
  return ColumnType;
15
- }({}); // Passing null/undefined in array types is not possible, so we us a special struct as a workaround.
16
- /** Used internally to transform the query params into a native format without nullish values */
17
- /**
18
- * Represents a value that can be stored in a SQLite database
19
- */
15
+ }({});
20
16
  /**
21
17
  * Allows the execution of bulk of sql commands
22
18
  * inside a transaction
23
19
  * If a single query must be executed many times with different arguments, its preferred
24
20
  * to declare it a single time, and use an array of array parameters.
25
21
  */
26
- /**
27
- * Used internally to transform the batch query commands into a native format without nullish values
28
- */
29
22
  /**
30
23
  * status: 0 or undefined for correct execution, 1 for error
31
24
  * message: if status === 1, here you will find error description
@@ -1 +1 @@
1
- {"version":3,"names":["ColumnType","exports"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;;;;;IAqBYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA,OAStB;AAWA;AAGA;AACA;AACA;AAwCA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["ColumnType","exports"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;;;;;IAuBYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAsDtB;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA","ignoreList":[]}
@@ -21,7 +21,6 @@ export const NitroSQLite = {
21
21
  executeBatchAsync
22
22
  };
23
23
  export { open } from "./operations/session.js";
24
- export { isNitroSQLiteNull, NITRO_SQLITE_NULL, isSimpleNullHandlingEnabled, enableSimpleNullHandling } from "./nullHandling.js";
25
24
  export { default as NitroSQLiteError } from "./NitroSQLiteError.js";
26
25
  export { typeORMDriver } from "./typeORM.js";
27
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["transaction","HybridNitroSQLite","open","execute","executeAsync","init","executeBatch","executeBatchAsync","NitroSQLite","native","isNitroSQLiteNull","NITRO_SQLITE_NULL","isSimpleNullHandlingEnabled","enableSimpleNullHandling","default","NitroSQLiteError","typeORMDriver"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,6BAA0B;AACtD,SAASC,iBAAiB,QAAQ,YAAS;AAC3C,SAASC,IAAI,QAAQ,yBAAsB;AAC3C,SAASC,OAAO,EAAEC,YAAY,QAAQ,yBAAsB;AAC5D,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,8BAA2B;AAE3EF,IAAI,CAAC,CAAC;AAEN,OAAO,MAAMG,WAAW,GAAG;EACzB,GAAGP,iBAAiB;EACpBQ,MAAM,EAAER,iBAAiB;EACzB;EACA;EACAC,IAAI;EACJ;EACAF,WAAW;EACXG,OAAO;EACPC,YAAY;EACZE,YAAY;EACZC;AACF,CAAC;AAED,SAASL,IAAI,QAAQ,yBAAsB;AAC3C,SACEQ,iBAAiB,EACjBC,iBAAiB,EACjBC,2BAA2B,EAC3BC,wBAAwB,QACnB,mBAAgB;AACvB,SAASC,OAAO,IAAIC,gBAAgB,QAAQ,uBAAoB;AAEhE,SAASC,aAAa,QAAQ,cAAW","ignoreList":[]}
1
+ {"version":3,"names":["transaction","HybridNitroSQLite","open","execute","executeAsync","init","executeBatch","executeBatchAsync","NitroSQLite","native","default","NitroSQLiteError","typeORMDriver"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,6BAA0B;AACtD,SAASC,iBAAiB,QAAQ,YAAS;AAC3C,SAASC,IAAI,QAAQ,yBAAsB;AAC3C,SAASC,OAAO,EAAEC,YAAY,QAAQ,yBAAsB;AAC5D,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,8BAA2B;AAE3EF,IAAI,CAAC,CAAC;AAEN,OAAO,MAAMG,WAAW,GAAG;EACzB,GAAGP,iBAAiB;EACpBQ,MAAM,EAAER,iBAAiB;EACzB;EACA;EACAC,IAAI;EACJ;EACAF,WAAW;EACXG,OAAO;EACPC,YAAY;EACZE,YAAY;EACZC;AACF,CAAC;AAED,SAASL,IAAI,QAAQ,yBAAsB;AAC3C,SAASQ,OAAO,IAAIC,gBAAgB,QAAQ,uBAAoB;AAEhE,SAASC,aAAa,QAAQ,cAAW","ignoreList":[]}
@@ -1,52 +1,38 @@
1
1
  "use strict";
2
2
 
3
- import { isNitroSQLiteNull, isSimpleNullHandlingEnabled } from "../nullHandling.js";
4
3
  import { HybridNitroSQLite } from "../nitro.js";
5
- import { replaceWithNativeNullValue } from "../nullHandling.js";
6
4
  import NitroSQLiteError from "../NitroSQLiteError.js";
7
5
  export function execute(dbName, query, params) {
8
- const transformedParams = isSimpleNullHandlingEnabled() ? toNativeQueryParams(params) : params;
9
6
  try {
10
- const nativeResult = HybridNitroSQLite.execute(dbName, query, transformedParams);
11
- return buildJsQueryResult(nativeResult);
7
+ const nativeResult = HybridNitroSQLite.execute(dbName, query, params);
8
+ return buildJSQueryResult(nativeResult);
12
9
  } catch (error) {
13
10
  throw NitroSQLiteError.fromError(error);
14
11
  }
15
12
  }
16
13
  export async function executeAsync(dbName, query, params) {
17
- const transformedParams = isSimpleNullHandlingEnabled() ? toNativeQueryParams(params) : params;
18
14
  try {
19
- const nativeResult = await HybridNitroSQLite.executeAsync(dbName, query, transformedParams);
20
- return buildJsQueryResult(nativeResult);
15
+ const nativeResult = await HybridNitroSQLite.executeAsync(dbName, query, params);
16
+ return buildJSQueryResult(nativeResult);
21
17
  } catch (error) {
22
18
  throw NitroSQLiteError.fromError(error);
23
19
  }
24
20
  }
25
- function toNativeQueryParams(params) {
26
- return params?.map(param => replaceWithNativeNullValue(param));
27
- }
28
- function buildJsQueryResult({
29
- insertId,
30
- rowsAffected,
31
- results
32
- }) {
33
- let data = results;
34
- if (isSimpleNullHandlingEnabled()) {
35
- data = results.map(row => Object.fromEntries(Object.entries(row).map(([key, value]) => {
36
- if (isNitroSQLiteNull(value)) {
37
- return [key, null];
38
- }
39
- return [key, value];
40
- })));
41
- }
42
- return {
43
- insertId,
44
- rowsAffected,
45
- rows: {
46
- _array: data,
47
- length: data.length,
48
- item: idx => data[idx]
49
- }
21
+ function buildJSQueryResult(result) {
22
+ const resultWithRows = result;
23
+ resultWithRows.rows = {
24
+ _array: result.results,
25
+ length: result.results.length,
26
+ item: idx => result.results[idx]
50
27
  };
28
+ return resultWithRows;
29
+
30
+ // return Object.assign(result, {
31
+ // rows: {
32
+ // _array: result.results,
33
+ // length: result.results.length,
34
+ // item: (idx: number) => result.results[idx],
35
+ // },
36
+ // })
51
37
  }
52
38
  //# sourceMappingURL=execute.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isNitroSQLiteNull","isSimpleNullHandlingEnabled","HybridNitroSQLite","replaceWithNativeNullValue","NitroSQLiteError","execute","dbName","query","params","transformedParams","toNativeQueryParams","nativeResult","buildJsQueryResult","error","fromError","executeAsync","map","param","insertId","rowsAffected","results","data","row","Object","fromEntries","entries","key","value","rows","_array","length","item","idx"],"sourceRoot":"../../../src","sources":["operations/execute.ts"],"mappings":";;AAAA,SAASA,iBAAi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B,2BAA2B,CAAC,CAAC,EAAE;IACjCoB,IAAI,GAAGD,OAAO,CAACJ,GAAG,CAAEM,GAAG,IACrBC,MAAM,CAACC,WAAW,CAChBD,MAAM,CAACE,OAAO,CAACH,GAAG,CAAC,CAACN,GAAG,CAAC,CAAC,CAACU,GAAG,EAAEC,KAAK,CAAC,KAAK;MACxC,IAAI3B,iBAAiB,CAAC2B,KAAK,CAAC,EAAE;QAC5B,OAAO,CAACD,GAAG,EAAE,IAAI,CAAC;MACpB;MACA,OAAO,CAACA,GAAG,EAAEC,KAAK,CAAC;IACrB,CAAC,CACH,CACF,CAAU;EACZ;EAEA,OAAO;IACLT,QAAQ;IACRC,YAAY;IACZS,IAAI,EAAE;MACJC,MAAM,EAAER,IAAI;MACZS,MAAM,EAAET,IAAI,CAACS,MAAM;MACnBC,IAAI,EAAGC,GAAW,IAAKX,IAAI,CAACW,GAAG;IACjC;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["HybridNitroSQLite","NitroSQLiteError","execute","dbName","query","params","nativeResult","buildJSQueryResult","error","fromError","executeAsync","result","resultWithRows","rows","_array","results","length","item","idx"],"sourceRoot":"../../../src","sources":["operations/execute.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,aAAU;AAE5C,OAAOC,gBAAgB,MAAM,wBAAqB;AAGlD,OAAO,SAASC,OAAOA,CACrBC,MAAc,EACdC,KAAa,EACbC,MAA0B,EACR;EAClB,IAAI;IACF,MAAMC,YAAY,GAAGN,iBAAiB,CAACE,OAAO,CAACC,MAAM,EAAEC,KAAK,EAAEC,MAAM,CAAC;IACrE,OAAOE,kBAAkB,CAAMD,YAAY,CAAC;EAC9C,CAAC,CAAC,OAAOE,KAAK,EAAE;IACd,MAAMP,gBAAgB,CAACQ,SAAS,CAACD,KAAK,CAAC;EACzC;AACF;AAEA,OAAO,eAAeE,YAAYA,CAChCP,MAAc,EACdC,KAAa,EACbC,MAA0B,EACC;EAC3B,IAAI;IACF,MAAMC,YAAY,GAAG,MAAMN,iBAAiB,CAACU,YAAY,CACvDP,MAAM,EACNC,KAAK,EACLC,MACF,CAAC;IACD,OAAOE,kBAAkB,CAAMD,YAAY,CAAC;EAC9C,CAAC,CAAC,OAAOE,KAAK,EAAE;IACd,MAAMP,gBAAgB,CAACQ,SAAS,CAACD,KAAK,CAAC;EACzC;AACF;AAEA,SAASD,kBAAkBA,CACzBI,MAA8B,EACZ;EAClB,MAAMC,cAAc,GAAGD,MAA0B;EAEjDC,cAAc,CAACC,IAAI,GAAG;IACpBC,MAAM,EAAEH,MAAM,CAACI,OAAgB;IAC/BC,MAAM,EAAEL,MAAM,CAACI,OAAO,CAACC,MAAM;IAC7BC,IAAI,EAAGC,GAAW,IAAKP,MAAM,CAACI,OAAO,CAACG,GAAG;EAC3C,CAAC;EAED,OAAON,cAAc;;EAErB;EACA;EACA;EACA;EACA;EACA;EACA;AACF","ignoreList":[]}
@@ -1,41 +1,24 @@
1
1
  "use strict";
2
2
 
3
- import { isSimpleNullHandlingEnabled, replaceWithNativeNullValue } from "../nullHandling.js";
4
3
  import { HybridNitroSQLite } from "../nitro.js";
5
4
  import { queueOperationAsync, startOperationSync, throwIfDatabaseIsNotOpen } from "../DatabaseQueue.js";
6
5
  import NitroSQLiteError from "../NitroSQLiteError.js";
7
6
  export function executeBatch(dbName, commands) {
8
7
  throwIfDatabaseIsNotOpen(dbName);
9
- const transformedCommands = isSimpleNullHandlingEnabled() ? toNativeBatchQueryCommands(commands) : commands;
10
8
  try {
11
- return startOperationSync(dbName, () => HybridNitroSQLite.executeBatch(dbName, transformedCommands));
9
+ return startOperationSync(dbName, () => HybridNitroSQLite.executeBatch(dbName, commands));
12
10
  } catch (error) {
13
11
  throw NitroSQLiteError.fromError(error);
14
12
  }
15
13
  }
16
14
  export async function executeBatchAsync(dbName, commands) {
17
15
  throwIfDatabaseIsNotOpen(dbName);
18
- const transformedCommands = isSimpleNullHandlingEnabled() ? toNativeBatchQueryCommands(commands) : commands;
19
16
  return queueOperationAsync(dbName, async () => {
20
17
  try {
21
- return await HybridNitroSQLite.executeBatchAsync(dbName, transformedCommands);
18
+ return await HybridNitroSQLite.executeBatchAsync(dbName, commands);
22
19
  } catch (error) {
23
20
  throw NitroSQLiteError.fromError(error);
24
21
  }
25
22
  });
26
23
  }
27
- function toNativeBatchQueryCommands(commands) {
28
- return commands.map(command => {
29
- const transformedParams = command.params?.map(param => {
30
- if (Array.isArray(param)) {
31
- return param.map(p => replaceWithNativeNullValue(p));
32
- }
33
- return replaceWithNativeNullValue(param);
34
- });
35
- return {
36
- query: command.query,
37
- params: transformedParams
38
- };
39
- });
40
- }
41
24
  //# sourceMappingURL=executeBatch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isSimpleNullHandlingEnabled","replaceWithNativeNullValue","HybridNitroSQLite","queueOperationAsync","startOperationSync","throwIfDatabaseIsNotOpen","NitroSQLiteError","executeBatch","dbName","commands","transformedCommands","toNativeBatchQueryCommands","error","fromError","executeBatchAsync","map","command","transformedParams","params","param","Array","isArray","p","query"],"sourceRoot":"../../../src","sources":["operations/executeBatch.ts"],"mappings":";;AAAA,SACEA,2BAA2B,EAC3BC,0BAA0B,QACrB,oBAAiB;AACxB,SAASC,iBAAiB,QAAQ,aAAU;AAC5C,SACEC,mBAAmB,EACnBC,kBAAkB,EAClBC,wBAAwB,QACnB,qBAAkB;AAOzB,OAAOC,gBAAgB,MAAM,wBAAqB;AAElD,OAAO,SAASC,YAAYA,CAC1BC,MAAc,EACdC,QAA6B,EACX;EAClBJ,wBAAwB,CAACG,MAAM,CAAC;EAEhC,MAAME,mBAAmB,GAAGV,2BAA2B,CAAC,CAAC,GACrDW,0BAA0B,CAACF,QAAQ,CAAC,GACnCA,QAAsC;EAE3C,IAAI;IACF,OAAOL,kBAAkB,CAACI,MAAM,EAAE,MAChCN,iBAAiB,CAACK,YAAY,CAACC,MAAM,EAAEE,mBAAmB,CAC5D,CAAC;EACH,CAAC,CAAC,OAAOE,KAAK,EAAE;IACd,MAAMN,gBAAgB,CAACO,SAAS,CAACD,KAAK,CAAC;EACzC;AACF;AAEA,OAAO,eAAeE,iBAAiBA,CACrCN,MAAc,EACdC,QAA6B,EACF;EAC3BJ,wBAAwB,CAACG,MAAM,CAAC;EAEhC,MAAME,mBAAmB,GAAGV,2BAA2B,CAAC,CAAC,GACrDW,0BAA0B,CAACF,QAAQ,CAAC,GACnCA,QAAsC;EAE3C,OAAON,mBAAmB,CAACK,MAAM,EAAE,YAAY;IAC7C,IAAI;MACF,OAAO,MAAMN,iBAAiB,CAACY,iBAAiB,CAC9CN,MAAM,EACNE,mBACF,CAAC;IACH,CAAC,CAAC,OAAOE,KAAK,EAAE;MACd,MAAMN,gBAAgB,CAACO,SAAS,CAACD,KAAK,CAAC;IACzC;EACF,CAAC,CAAC;AACJ;AAEA,SAASD,0BAA0BA,CACjCF,QAA6B,EACF;EAC3B,OAAOA,QAAQ,CAACM,GAAG,CAAEC,OAAO,IAAK;IAC/B,MAAMC,iBAAiB,GAAGD,OAAO,CAACE,MAAM,EAAEH,GAAG,CAAEI,KAAK,IAAK;MACvD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;QACxB,OAAOA,KAAK,CAACJ,GAAG,CAAEO,CAAC,IAAKrB,0BAA0B,CAACqB,CAAC,CAAC,CAAC;MACxD;MACA,OAAOrB,0BAA0B,CAACkB,KAAK,CAAC;IAC1C,CAAC,CAAwD;IAEzD,OAAO;MACLI,KAAK,EAAEP,OAAO,CAACO,KAAK;MACpBL,MAAM,EAAED;IACV,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["HybridNitroSQLite","queueOperationAsync","startOperationSync","throwIfDatabaseIsNotOpen","NitroSQLiteError","executeBatch","dbName","commands","error","fromError","executeBatchAsync"],"sourceRoot":"../../../src","sources":["operations/executeBatch.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,aAAU;AAC5C,SACEC,mBAAmB,EACnBC,kBAAkB,EAClBC,wBAAwB,QACnB,qBAAkB;AACzB,OAAOC,gBAAgB,MAAM,wBAAqB;AAGlD,OAAO,SAASC,YAAYA,CAC1BC,MAAc,EACdC,QAA6B,EACX;EAClBJ,wBAAwB,CAACG,MAAM,CAAC;EAEhC,IAAI;IACF,OAAOJ,kBAAkB,CAACI,MAAM,EAAE,MAChCN,iBAAiB,CAACK,YAAY,CAACC,MAAM,EAAEC,QAAQ,CACjD,CAAC;EACH,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,MAAMJ,gBAAgB,CAACK,SAAS,CAACD,KAAK,CAAC;EACzC;AACF;AAEA,OAAO,eAAeE,iBAAiBA,CACrCJ,MAAc,EACdC,QAA6B,EACF;EAC3BJ,wBAAwB,CAACG,MAAM,CAAC;EAEhC,OAAOL,mBAAmB,CAACK,MAAM,EAAE,YAAY;IAC7C,IAAI;MACF,OAAO,MAAMN,iBAAiB,CAACU,iBAAiB,CAACJ,MAAM,EAAEC,QAAQ,CAAC;IACpE,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMJ,gBAAgB,CAACK,SAAS,CAACD,KAAK,CAAC;IACzC;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=NitroSQLiteQueryResult.nitro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NitroSQLiteQueryResult.nitro.ts"],"mappings":"","ignoreList":[]}
@@ -10,14 +10,6 @@ export let ColumnType = /*#__PURE__*/function (ColumnType) {
10
10
  return ColumnType;
11
11
  }({});
12
12
 
13
- // Passing null/undefined in array types is not possible, so we us a special struct as a workaround.
14
-
15
- /** Used internally to transform the query params into a native format without nullish values */
16
-
17
- /**
18
- * Represents a value that can be stored in a SQLite database
19
- */
20
-
21
13
  /**
22
14
  * Allows the execution of bulk of sql commands
23
15
  * inside a transaction
@@ -25,10 +17,6 @@ export let ColumnType = /*#__PURE__*/function (ColumnType) {
25
17
  * to declare it a single time, and use an array of array parameters.
26
18
  */
27
19
 
28
- /**
29
- * Used internally to transform the batch query commands into a native format without nullish values
30
- */
31
-
32
20
  /**
33
21
  * status: 0 or undefined for correct execution, 1 for error
34
22
  * message: if status === 1, here you will find error description
@@ -1 +1 @@
1
- {"version":3,"names":["ColumnType"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AAqBA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;;AAStB;;AAWA;;AAGA;AACA;AACA;;AAwCA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["ColumnType"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AAuBA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;;AAsDtB;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA","ignoreList":[]}
@@ -25,7 +25,6 @@ export declare const NitroSQLite: {
25
25
  dispose(): void;
26
26
  };
27
27
  export { open } from './operations/session';
28
- export { isNitroSQLiteNull, NITRO_SQLITE_NULL, isSimpleNullHandlingEnabled, enableSimpleNullHandling, } from './nullHandling';
29
28
  export { default as NitroSQLiteError } from './NitroSQLiteError';
30
29
  export type * from './types';
31
30
  export { typeORMDriver } from './typeORM';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAI3E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAYvB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAChE,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAI3E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAYvB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAChE,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { QueryResult, SQLiteQueryParams, QueryResultRow } from '../types';
1
+ import type { QueryResult, QueryResultRow, SQLiteQueryParams } from '../types';
2
2
  export declare function execute<Row extends QueryResultRow = never>(dbName: string, query: string, params?: SQLiteQueryParams): QueryResult<Row>;
3
3
  export declare function executeAsync<Row extends QueryResultRow = never>(dbName: string, query: string, params?: SQLiteQueryParams): Promise<QueryResult<Row>>;
4
4
  //# sourceMappingURL=execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/operations/execute.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EAEX,iBAAiB,EACjB,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB,wBAAgB,OAAO,CAAC,GAAG,SAAS,cAAc,GAAG,KAAK,EACxD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,WAAW,CAAC,GAAG,CAAC,CAgBlB;AAED,wBAAsB,YAAY,CAAC,GAAG,SAAS,cAAc,GAAG,KAAK,EACnE,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAe3B"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/operations/execute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAI9E,wBAAgB,OAAO,CAAC,GAAG,SAAS,cAAc,GAAG,KAAK,EACxD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,WAAW,CAAC,GAAG,CAAC,CAOlB;AAED,wBAAsB,YAAY,CAAC,GAAG,SAAS,cAAc,GAAG,KAAK,EACnE,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAW3B"}
@@ -1,4 +1,4 @@
1
- import type { BatchQueryResult, BatchQueryCommand } from '../types';
1
+ import type { BatchQueryCommand, BatchQueryResult } from '../types';
2
2
  export declare function executeBatch(dbName: string, commands: BatchQueryCommand[]): BatchQueryResult;
3
3
  export declare function executeBatchAsync(dbName: string, commands: BatchQueryCommand[]): Promise<BatchQueryResult>;
4
4
  //# sourceMappingURL=executeBatch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executeBatch.d.ts","sourceRoot":"","sources":["../../../../src/operations/executeBatch.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAEV,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,UAAU,CAAA;AAGjB,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,gBAAgB,CAclB;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
1
+ {"version":3,"file":"executeBatch.d.ts","sourceRoot":"","sources":["../../../../src/operations/executeBatch.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEnE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,gBAAgB,CAUlB;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAU3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../src/operations/transaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,UAAU,CAAA;AAIjB,eAAO,MAAM,WAAW,GAAU,MAAM,GAAG,IAAI,EAC7C,QAAQ,MAAM,EACd,qBAAqB,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,EACzD,qBAAmB,oBA+EpB,CAAA"}
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../src/operations/transaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EAIZ,MAAM,UAAU,CAAA;AAIjB,eAAO,MAAM,WAAW,GAAU,MAAM,GAAG,IAAI,EAC7C,QAAQ,MAAM,EACd,qBAAqB,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,EACzD,qBAAmB,oBA+EpB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { HybridObject } from 'react-native-nitro-modules';
2
- import type { BatchQueryResult, FileLoadResult, NativeSQLiteQueryParams, NativeBatchQueryCommand } from '../types';
3
- import type { NativeQueryResult } from './NativeQueryResult.nitro';
2
+ import type { BatchQueryCommand, BatchQueryResult, FileLoadResult, SQLiteQueryParams } from '../types';
3
+ import type { NitroSQLiteQueryResult } from './NitroSQLiteQueryResult.nitro';
4
4
  export interface NitroSQLite extends HybridObject<{
5
5
  ios: 'c++';
6
6
  android: 'c++';
@@ -10,10 +10,10 @@ export interface NitroSQLite extends HybridObject<{
10
10
  drop(dbName: string, location?: string): void;
11
11
  attach(mainDbName: string, dbNameToAttach: string, alias: string, location?: string): void;
12
12
  detach(mainDbName: string, alias: string): void;
13
- execute(dbName: string, query: string, params?: NativeSQLiteQueryParams): NativeQueryResult;
14
- executeAsync(dbName: string, query: string, params?: NativeSQLiteQueryParams): Promise<NativeQueryResult>;
15
- executeBatch(dbName: string, commands: NativeBatchQueryCommand[]): BatchQueryResult;
16
- executeBatchAsync(dbName: string, commands: NativeBatchQueryCommand[]): Promise<BatchQueryResult>;
13
+ execute(dbName: string, query: string, params?: SQLiteQueryParams): NitroSQLiteQueryResult;
14
+ executeAsync(dbName: string, query: string, params?: SQLiteQueryParams): Promise<NitroSQLiteQueryResult>;
15
+ executeBatch(dbName: string, commands: BatchQueryCommand[]): BatchQueryResult;
16
+ executeBatchAsync(dbName: string, commands: BatchQueryCommand[]): Promise<BatchQueryResult>;
17
17
  loadFile(dbName: string, location: string): FileLoadResult;
18
18
  loadFileAsync(dbName: string, location: string): Promise<FileLoadResult>;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NitroSQLite.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/NitroSQLite.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAElE,MAAM,WAAW,WACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;IACpD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7C,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7C,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAAA;IACP,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/C,OAAO,CACL,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,uBAAuB,GAC/B,iBAAiB,CAAA;IACpB,YAAY,CACV,MAAM,EAAE,MAAM,EACd,K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E,MAAM,GAChB,IAAI,CAAA;IACP,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/C,OAAO,CACL,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,sBAAsB,CAAA;IACzB,YAAY,CACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAClC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,gBAAgB,CAAA;IAC7E,iBAAiB,CACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAA;IAC1D,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;CACzE"}
@@ -8,31 +8,25 @@ import type { ColumnType, SQLiteValue } from '../types';
8
8
  * rows: if status is undefined or 0 this object will contain the query results
9
9
  * }
10
10
  *
11
- * @interface NativeQueryResult
11
+ * @interface QueryResult
12
12
  */
13
- export interface NativeQueryResult extends HybridObject<{
13
+ export interface NitroSQLiteQueryResult extends HybridObject<{
14
14
  ios: 'c++';
15
15
  android: 'c++';
16
16
  }> {
17
17
  readonly rowsAffected: number;
18
18
  readonly insertId?: number;
19
19
  /** Query results */
20
- readonly results: NativeSQLiteQueryResults;
20
+ readonly results: Record<string, SQLiteValue>[];
21
21
  /** Table metadata */
22
- readonly metadata?: Record<string, SQLiteQueryColumnMetadata>;
22
+ readonly metadata?: Record<string, NitroSQLiteQueryColumnMetadata>;
23
23
  }
24
- /**
25
- * Table metadata
26
- * Describes some information about the table and it's columns fetched by the query
27
- * The index is the name of the column
28
- */
29
- export type NativeSQLiteQueryResults = Record<string, SQLiteValue>[];
30
- export interface SQLiteQueryColumnMetadata {
24
+ export type NitroSQLiteQueryColumnMetadata = {
31
25
  /** The name used for this column for this result set */
32
26
  name: string;
33
27
  /** The declared column type for this column, when fetched directly from a table or a View resulting from a table column. "UNKNOWN" for dynamic values, like function returned ones. */
34
28
  type: ColumnType;
35
29
  /** The index for this column for this result set */
36
30
  index: number;
37
- }
38
- //# sourceMappingURL=NativeQueryResult.nitro.d.ts.map
31
+ };
32
+ //# sourceMappingURL=NitroSQLiteQueryResult.nitro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NitroSQLiteQueryResult.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/NitroSQLiteQueryResult.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEvD;;;;;;;;;GASG;AACH,MAAM,WAAW,sBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAE1B,oBAAoB;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAA;IAE/C,qBAAqB;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAA;CACnE;AASD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IAEZ,uLAAuL;IACvL,IAAI,EAAE,UAAU,CAAA;IAEhB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { QueryResult, Transaction, SQLiteQueryParams, QueryResultRow } from './types';
1
+ import type { Transaction, SQLiteQueryParams, QueryResultRow, QueryResult } from './types';
2
2
  interface TypeOrmNitroSQLiteConnection {
3
3
  executeSql: <RowData extends QueryResultRow = never>(sql: string, params: SQLiteQueryParams | undefined, okExecute: (res: QueryResult<RowData>) => void, failExecute: (msg: string) => void) => Promise<void>;
4
4
  transaction: (fn: (tx: Transaction) => Promise<void>) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"typeORM.d.ts","sourceRoot":"","sources":["../../../src/typeORM.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,cAAc,EACf,MAAM,SAAS,CAAA;AAGhB,UAAU,4BAA4B;IACpC,UAAU,EAAE,CAAC,OAAO,SAAS,cAAc,GAAG,KAAK,EACjD,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,SAAS,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI,EAC9C,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KAC/B,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACtE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAA;IACrE,MAAM,EAAE,CACN,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,MAAM,IAAI,KACjB,IAAI,CAAA;IACT,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AE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAA;CACtD;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;4BAEb;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,MACG,CAAC,EAAE,EAAE,4BAA4B,KAAK,IAAI,QACxC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KAC1B,4BAA4B,GAAG,IAAI;CAuDvC,CAAA"}
@@ -1,3 +1,4 @@
1
+ import type { NitroSQLiteQueryResult } from './specs/NitroSQLiteQueryResult.nitro';
1
2
  export interface NitroSQLiteConnectionOptions {
2
3
  name: string;
3
4
  location?: string;
@@ -23,39 +24,29 @@ export declare enum ColumnType {
23
24
  ARRAY_BUFFER = 4,
24
25
  NULL_VALUE = 5
25
26
  }
26
- export type SQLiteNullValue = {
27
- isNitroSQLiteNull: true;
27
+ export type SQLiteValue = boolean | number | string | ArrayBuffer | null;
28
+ export type SQLiteQueryParams = SQLiteValue[];
29
+ export type QueryResultRow = Record<string, SQLiteValue>;
30
+ export type QueryResult<Row extends QueryResultRow = QueryResultRow> = NitroSQLiteQueryResult & {
31
+ /** Query results in a row format for TypeORM compatibility */
32
+ rows: NitroSQLiteQueryResultRows<Row>;
28
33
  };
29
- export type SQLiteValue = boolean | number | string | ArrayBuffer | SQLiteNullValue;
30
- /** Used internally to transform the query params into a native format without nullish values */
31
- export type NativeSQLiteQueryParams = SQLiteValue[];
32
- /**
33
- * Represents a value that can be stored in a SQLite database
34
- */
35
- export type SQLiteQueryParamItem = SQLiteValue | null | undefined;
36
- export type SQLiteQueryParams = SQLiteQueryParamItem[];
37
- export type QueryResultRowItem = SQLiteValue | undefined;
38
- export type QueryResultRow = Record<string, QueryResultRowItem>;
39
- export interface QueryResult<Row extends QueryResultRow = QueryResultRow> {
40
- readonly insertId?: number;
41
- readonly rowsAffected: number;
42
- readonly rows?: {
43
- /** Raw array with all dataset */
44
- _array: Row[];
45
- /** The lengh of the dataset */
46
- length: number;
47
- /** A convenience function to acess the index based the row object
48
- * @param idx the row index
49
- * @returns the row structure identified by column names
50
- */
51
- item: (idx: number) => Row | undefined;
52
- };
53
- }
54
- export type ExecuteQuery = <Row extends QueryResultRow = QueryResultRow>(query: string, params?: SQLiteQueryParams) => QueryResult<Row>;
34
+ export type NitroSQLiteQueryResultRows<Row extends Record<string, SQLiteValue> = Record<string, SQLiteValue>> = {
35
+ /** Raw array with all dataset */
36
+ _array: Row[];
37
+ /** The lengh of the dataset */
38
+ length: number;
39
+ /** A convenience function to acess the index based the row object
40
+ * @param idx the row index
41
+ * @returns the row structure identified by column names
42
+ */
43
+ item: (idx: number) => Row | undefined;
44
+ };
45
+ export type ExecuteQuery = <Row extends QueryResultRow = QueryResultRow>(query: string, params?: SQLiteValue[]) => QueryResult<Row>;
55
46
  export type ExecuteAsyncQuery = <Row extends QueryResultRow = QueryResultRow>(query: string, params?: SQLiteQueryParams) => Promise<QueryResult<Row>>;
56
47
  export interface Transaction {
57
- commit(): QueryResult;
58
- rollback(): QueryResult;
48
+ commit(): NitroSQLiteQueryResult;
49
+ rollback(): NitroSQLiteQueryResult;
59
50
  execute: ExecuteQuery;
60
51
  executeAsync: ExecuteAsyncQuery;
61
52
  }
@@ -69,13 +60,6 @@ export interface BatchQueryCommand {
69
60
  query: string;
70
61
  params?: SQLiteQueryParams | SQLiteQueryParams[];
71
62
  }
72
- /**
73
- * Used internally to transform the batch query commands into a native format without nullish values
74
- */
75
- export interface NativeBatchQueryCommand {
76
- query: string;
77
- params?: NativeSQLiteQueryParams | NativeSQLiteQueryParams[];
78
- }
79
63
  /**
80
64
  * status: 0 or undefined for correct execution, 1 for error
81
65
  * message: if status === 1, here you will find error description
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,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AAsB,CAAA;IAChC,QAAQ,IAAI,sBAAsB,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;IACrB,YAAY,EAAE,iBAAiB,CAAA;CAChC;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,CAAA;CACjD;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB"}
@@ -25,7 +25,6 @@ export declare const NitroSQLite: {
25
25
  dispose(): void;
26
26
  };
27
27
  export { open } from './operations/session';
28
- export { isNitroSQLiteNull, NITRO_SQLITE_NULL, isSimpleNullHandlingEnabled, enableSimpleNullHandling, } from './nullHandling';
29
28
  export { default as NitroSQLiteError } from './NitroSQLiteError';
30
29
  export type * from './types';
31
30
  export { typeORMDriver } from './typeORM';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAI3E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAYvB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAChE,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAI3E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAYvB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAChE,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { QueryResult, SQLiteQueryParams, QueryResultRow } from '../types';
1
+ import type { QueryResult, QueryResultRow, SQLiteQueryParams } from '../types';
2
2
  export declare function execute<Row extends QueryResultRow = never>(dbName: string, query: string, params?: SQLiteQueryParams): QueryResult<Row>;
3
3
  export declare function executeAsync<Row extends QueryResultRow = never>(dbName: string, query: string, params?: SQLiteQueryParams): Promise<QueryResult<Row>>;
4
4
  //# sourceMappingURL=execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/operations/execute.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EAEX,iBAAiB,EACjB,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB,wBAAgB,OAAO,CAAC,GAAG,SAAS,cAAc,GAAG,KAAK,EACxD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,WAAW,CAAC,GAAG,CAAC,CAgBlB;AAED,wBAAsB,YAAY,CAAC,GAAG,SAAS,cAAc,GAAG,KAAK,EACnE,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAe3B"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/operations/execute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAI9E,wBAAgB,OAAO,CAAC,GAAG,SAAS,cAAc,GAAG,KAAK,EACxD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,WAAW,CAAC,GAAG,CAAC,CAOlB;AAED,wBAAsB,YAAY,CAAC,GAAG,SAAS,cAAc,GAAG,KAAK,EACnE,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAW3B"}
@@ -1,4 +1,4 @@
1
- import type { BatchQueryResult, BatchQueryCommand } from '../types';
1
+ import type { BatchQueryCommand, BatchQueryResult } from '../types';
2
2
  export declare function executeBatch(dbName: string, commands: BatchQueryCommand[]): BatchQueryResult;
3
3
  export declare function executeBatchAsync(dbName: string, commands: BatchQueryCommand[]): Promise<BatchQueryResult>;
4
4
  //# sourceMappingURL=executeBatch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executeBatch.d.ts","sourceRoot":"","sources":["../../../../src/operations/executeBatch.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAEV,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,UAAU,CAAA;AAGjB,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,gBAAgB,CAclB;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
1
+ {"version":3,"file":"executeBatch.d.ts","sourceRoot":"","sources":["../../../../src/operations/executeBatch.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEnE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,gBAAgB,CAUlB;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAU3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../src/operations/transaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,UAAU,CAAA;AAIjB,eAAO,MAAM,WAAW,GAAU,MAAM,GAAG,IAAI,EAC7C,QAAQ,MAAM,EACd,qBAAqB,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,EACzD,qBAAmB,oBA+EpB,CAAA"}
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../src/operations/transaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EAIZ,MAAM,UAAU,CAAA;AAIjB,eAAO,MAAM,WAAW,GAAU,MAAM,GAAG,IAAI,EAC7C,QAAQ,MAAM,EACd,qBAAqB,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,EACzD,qBAAmB,oBA+EpB,CAAA"}