react-native-nitro-sqlite 8.2.2-nitro.1 → 9.0.1

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 (108) hide show
  1. package/RNNitroSQLite.podspec +22 -5
  2. package/android/CMakeLists.txt +42 -5
  3. package/android/build.gradle +83 -23
  4. package/android/{src/main/cpp/cpp-adapter.cpp → cpp-adapter.cpp} +1 -1
  5. package/android/gradle.properties +5 -0
  6. package/android/src/main/java/com/margelo/rnnitrosqlite/DocPathSetter.kt +13 -0
  7. package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.kt +40 -0
  8. package/android/src/newarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt +41 -0
  9. package/android/src/oldarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt +43 -0
  10. package/cpp/operations.cpp +0 -3
  11. package/cpp/sqlite/sqlite3.c +41 -41
  12. package/cpp/sqliteExecuteBatch.cpp +0 -1
  13. package/lib/commonjs/index.js +6 -6
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/nitro.js.map +1 -1
  16. package/lib/commonjs/operations/execute.js +1 -1
  17. package/lib/commonjs/operations/execute.js.map +1 -1
  18. package/lib/commonjs/operations/session.js +3 -3
  19. package/lib/commonjs/operations/session.js.map +1 -1
  20. package/lib/commonjs/operations/transaction.js +4 -7
  21. package/lib/commonjs/operations/transaction.js.map +1 -1
  22. package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.ios.js.map +1 -1
  23. package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.js.map +1 -1
  24. package/lib/commonjs/specs/NativeQueryResult.nitro.js.map +1 -1
  25. package/lib/commonjs/specs/NitroSQLite.nitro.js.map +1 -1
  26. package/lib/commonjs/typeORM.js +1 -1
  27. package/lib/commonjs/typeORM.js.map +1 -1
  28. package/lib/commonjs/types.js +0 -1
  29. package/lib/commonjs/types.js.map +1 -1
  30. package/lib/module/index.js +9 -7
  31. package/lib/module/index.js.map +1 -1
  32. package/lib/module/nitro.js +2 -0
  33. package/lib/module/nitro.js.map +1 -1
  34. package/lib/module/operations/execute.js +3 -1
  35. package/lib/module/operations/execute.js.map +1 -1
  36. package/lib/module/operations/session.js +5 -3
  37. package/lib/module/operations/session.js.map +1 -1
  38. package/lib/module/operations/transaction.js +6 -7
  39. package/lib/module/operations/transaction.js.map +1 -1
  40. package/lib/module/specs/NativeNitroSQLiteOnLoad.ios.js +2 -0
  41. package/lib/module/specs/NativeNitroSQLiteOnLoad.ios.js.map +1 -1
  42. package/lib/module/specs/NativeNitroSQLiteOnLoad.js +2 -0
  43. package/lib/module/specs/NativeNitroSQLiteOnLoad.js.map +1 -1
  44. package/lib/module/specs/NativeQueryResult.nitro.js +2 -0
  45. package/lib/module/specs/NativeQueryResult.nitro.js.map +1 -1
  46. package/lib/module/specs/NitroSQLite.nitro.js +2 -0
  47. package/lib/module/specs/NitroSQLite.nitro.js.map +1 -1
  48. package/lib/module/typeORM.js +3 -1
  49. package/lib/module/typeORM.js.map +1 -1
  50. package/lib/module/types.js +2 -1
  51. package/lib/module/types.js.map +1 -1
  52. package/lib/tsconfig.build.tsbuildinfo +1 -0
  53. package/lib/typescript/{index.d.ts → commonjs/index.d.ts} +1 -0
  54. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  55. package/lib/typescript/{nitro.d.ts → commonjs/nitro.d.ts} +1 -0
  56. package/lib/typescript/commonjs/nitro.d.ts.map +1 -0
  57. package/lib/typescript/{operations → commonjs/operations}/execute.d.ts +1 -0
  58. package/lib/typescript/commonjs/operations/execute.d.ts.map +1 -0
  59. package/lib/typescript/{operations → commonjs/operations}/session.d.ts +1 -0
  60. package/lib/typescript/commonjs/operations/session.d.ts.map +1 -0
  61. package/lib/typescript/{operations → commonjs/operations}/transaction.d.ts +1 -0
  62. package/lib/typescript/commonjs/operations/transaction.d.ts.map +1 -0
  63. package/lib/typescript/commonjs/package.json +1 -0
  64. package/lib/typescript/{specs → commonjs/specs}/NativeNitroSQLiteOnLoad.d.ts +1 -0
  65. package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.d.ts.map +1 -0
  66. package/lib/typescript/{specs → commonjs/specs}/NativeNitroSQLiteOnLoad.ios.d.ts +1 -0
  67. package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.ios.d.ts.map +1 -0
  68. package/lib/typescript/{specs → commonjs/specs}/NativeQueryResult.nitro.d.ts +1 -0
  69. package/lib/typescript/commonjs/specs/NativeQueryResult.nitro.d.ts.map +1 -0
  70. package/lib/typescript/{specs → commonjs/specs}/NitroSQLite.nitro.d.ts +1 -0
  71. package/lib/typescript/commonjs/specs/NitroSQLite.nitro.d.ts.map +1 -0
  72. package/lib/typescript/{typeORM.d.ts → commonjs/typeORM.d.ts} +1 -0
  73. package/lib/typescript/commonjs/typeORM.d.ts.map +1 -0
  74. package/lib/typescript/{types.d.ts → commonjs/types.d.ts} +1 -0
  75. package/lib/typescript/commonjs/types.d.ts.map +1 -0
  76. package/lib/typescript/module/index.d.ts +31 -0
  77. package/lib/typescript/module/index.d.ts.map +1 -0
  78. package/lib/typescript/module/nitro.d.ts +8 -0
  79. package/lib/typescript/module/nitro.d.ts.map +1 -0
  80. package/lib/typescript/module/operations/execute.d.ts +4 -0
  81. package/lib/typescript/module/operations/execute.d.ts.map +1 -0
  82. package/lib/typescript/module/operations/session.d.ts +5 -0
  83. package/lib/typescript/module/operations/session.d.ts.map +1 -0
  84. package/lib/typescript/module/operations/transaction.d.ts +6 -0
  85. package/lib/typescript/module/operations/transaction.d.ts.map +1 -0
  86. package/lib/typescript/module/package.json +1 -0
  87. package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.d.ts +7 -0
  88. package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.d.ts.map +1 -0
  89. package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.ios.d.ts +4 -0
  90. package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.ios.d.ts.map +1 -0
  91. package/lib/typescript/module/specs/NativeQueryResult.nitro.d.ts +38 -0
  92. package/lib/typescript/module/specs/NativeQueryResult.nitro.d.ts.map +1 -0
  93. package/lib/typescript/module/specs/NitroSQLite.nitro.d.ts +20 -0
  94. package/lib/typescript/module/specs/NitroSQLite.nitro.d.ts.map +1 -0
  95. package/lib/typescript/module/typeORM.d.ts +20 -0
  96. package/lib/typescript/module/typeORM.d.ts.map +1 -0
  97. package/lib/typescript/module/types.d.ts +80 -0
  98. package/lib/typescript/module/types.d.ts.map +1 -0
  99. package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake +13 -1
  100. package/nitrogen/generated/android/RNNitroSQLite+autolinking.gradle +2 -0
  101. package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb +1 -1
  102. package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp +0 -6
  103. package/package.json +87 -43
  104. package/src/operations/transaction.ts +2 -3
  105. package/src/types.ts +0 -1
  106. package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.java +0 -57
  107. package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.java +0 -48
  108. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -13384,7 +13384,7 @@ extern unsigned int sqlite3CoverageCounter;
13384
13384
  /*
13385
13385
  ** Some conditionals are optimizations only. In other words, if the
13386
13386
  ** conditionals are replaced with a constant 1 (true) or 0 (false) then
13387
- ** the correct answer is still obtained, though perhaps not as Nitroly.
13387
+ ** the correct answer is still obtained, though perhaps not as quickly.
13388
13388
  **
13389
13389
  ** The following macros mark these optimizations conditionals.
13390
13390
  */
@@ -21251,8 +21251,8 @@ static const char* const sqlite3azCompileOpt[] = {
21251
21251
  #ifdef SQLITE_OMIT_PROGRESS_CALLBACK
21252
21252
  "OMIT_PROGRESS_CALLBACK",
21253
21253
  #endif
21254
- #ifdef SQLITE_OMIT_NitroBALANCE
21255
- "OMIT_NitroBALANCE",
21254
+ #ifdef SQLITE_OMIT_QUICKBALANCE
21255
+ "OMIT_QUICKBALANCE",
21256
21256
  #endif
21257
21257
  #ifdef SQLITE_OMIT_REINDEX
21258
21258
  "OMIT_REINDEX",
@@ -38734,7 +38734,7 @@ SQLITE_API int sqlite3_fullsync_count = 0;
38734
38734
  ** it work better.
38735
38735
  **
38736
38736
  ** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful
38737
- ** for testing when we want to run through the test suite Nitroly.
38737
+ ** for testing when we want to run through the test suite quickly.
38738
38738
  ** You are strongly advised *not* to deploy with SQLITE_NO_SYNC
38739
38739
  ** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash
38740
38740
  ** or power failure will likely corrupt the database file.
@@ -60920,7 +60920,7 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager* pPager) {
60920
60920
  ** as big endian, the wal-index can store multi-byte values in the native
60921
60921
  ** byte order of the host computer.
60922
60922
  **
60923
- ** The purpose of the wal-index is to answer this question Nitroly: Given
60923
+ ** The purpose of the wal-index is to answer this question quickly: Given
60924
60924
  ** a page number P and a maximum frame index M, return the index of the
60925
60925
  ** last frame in the wal before frame M for page P in the WAL, or return
60926
60926
  ** NULL if there are no frames for page P in the WAL prior to M.
@@ -65537,7 +65537,7 @@ struct BtCursor {
65537
65537
  ** The purpose of the pointer map is to facility moving pages from one
65538
65538
  ** position in the file to another as part of autovacuum. When a page
65539
65539
  ** is moved, the pointer in its parent must be updated to point to the
65540
- ** new location. The pointer map is used to locate the parent page Nitroly.
65540
+ ** new location. The pointer map is used to locate the parent page quickly.
65541
65541
  **
65542
65542
  ** PTRMAP_ROOTPAGE: The database page is a root-page. The page-number is not
65543
65543
  ** used in this case.
@@ -71138,7 +71138,7 @@ static const void* fetchPayload(BtCursor* pCur, /* Cursor pointing to entry to r
71138
71138
  ** Hence, a mutex on the BtShared should be held prior to calling
71139
71139
  ** this routine.
71140
71140
  **
71141
- ** These routines is used to get Nitro access to key and data
71141
+ ** These routines is used to get quick access to key and data
71142
71142
  ** in the common case where no overflow pages are used.
71143
71143
  */
71144
71144
  SQLITE_PRIVATE const void* sqlite3BtreePayloadFetch(BtCursor* pCur, u32* pAmt) {
@@ -73496,7 +73496,7 @@ editpage_fail:
73496
73496
  return rebuildPage(pCArray, iNew, nNew, pPg);
73497
73497
  }
73498
73498
 
73499
- #ifndef SQLITE_OMIT_NitroBALANCE
73499
+ #ifndef SQLITE_OMIT_QUICKBALANCE
73500
73500
  /*
73501
73501
  ** This version of balance() handles the common special case where
73502
73502
  ** a new entry is being inserted on the extreme right-end of the
@@ -73507,7 +73507,7 @@ editpage_fail:
73507
73507
  ** a new page to the right-hand side and put the one new entry in
73508
73508
  ** that page. This leaves the right side of the tree somewhat
73509
73509
  ** unbalanced. But odds are that we will be inserting new entries
73510
- ** at the end soon afterwards so the nearly empty page will Nitroly
73510
+ ** at the end soon afterwards so the nearly empty page will quickly
73511
73511
  ** fill up. On average.
73512
73512
  **
73513
73513
  ** pPage is the leaf page which is the right-most page in the tree.
@@ -73520,7 +73520,7 @@ editpage_fail:
73520
73520
  ** words, at most 13 bytes. Hence the pSpace buffer must be at
73521
73521
  ** least 13 bytes in size.
73522
73522
  */
73523
- static int balance_Nitro(MemPage* pParent, MemPage* pPage, u8* pSpace) {
73523
+ static int balance_quick(MemPage* pParent, MemPage* pPage, u8* pSpace) {
73524
73524
  BtShared* const pBt = pPage->pBt; /* B-Tree Database */
73525
73525
  MemPage* pNew; /* Newly allocated page */
73526
73526
  int rc; /* Return Code */
@@ -73616,7 +73616,7 @@ static int balance_Nitro(MemPage* pParent, MemPage* pPage, u8* pSpace) {
73616
73616
 
73617
73617
  return rc;
73618
73618
  }
73619
- #endif /* SQLITE_OMIT_NitroBALANCE */
73619
+ #endif /* SQLITE_OMIT_QUICKBALANCE */
73620
73620
 
73621
73621
  #if 0
73622
73622
  /*
@@ -74615,16 +74615,16 @@ static int anotherValidCursor(BtCursor* pCur) {
74615
74615
  ** tree needs to be balanced, and if so calls the appropriate balancing
74616
74616
  ** routine. Balancing routines are:
74617
74617
  **
74618
- ** balance_Nitro()
74618
+ ** balance_quick()
74619
74619
  ** balance_deeper()
74620
74620
  ** balance_nonroot()
74621
74621
  */
74622
74622
  static int balance(BtCursor* pCur) {
74623
74623
  int rc = SQLITE_OK;
74624
- u8 aBalanceNitroSpace[13];
74624
+ u8 aBalanceQuickSpace[13];
74625
74625
  u8* pFree = 0;
74626
74626
 
74627
- VVA_ONLY(int balance_Nitro_called = 0);
74627
+ VVA_ONLY(int balance_quick_called = 0);
74628
74628
  VVA_ONLY(int balance_deeper_called = 0);
74629
74629
 
74630
74630
  do {
@@ -74669,25 +74669,25 @@ static int balance(BtCursor* pCur) {
74669
74669
  rc = btreeComputeFreeSpace(pParent);
74670
74670
  }
74671
74671
  if (rc == SQLITE_OK) {
74672
- #ifndef SQLITE_OMIT_NitroBALANCE
74672
+ #ifndef SQLITE_OMIT_QUICKBALANCE
74673
74673
  if (pPage->intKeyLeaf && pPage->nOverflow == 1 && pPage->aiOvfl[0] == pPage->nCell && pParent->pgno != 1 &&
74674
74674
  pParent->nCell == iIdx) {
74675
- /* Call balance_Nitro() to create a new sibling of pPage on which
74676
- ** to store the overflow cell. balance_Nitro() inserts a new cell
74675
+ /* Call balance_quick() to create a new sibling of pPage on which
74676
+ ** to store the overflow cell. balance_quick() inserts a new cell
74677
74677
  ** into pParent, which may cause pParent overflow. If this
74678
74678
  ** happens, the next iteration of the do-loop will balance pParent
74679
74679
  ** use either balance_nonroot() or balance_deeper(). Until this
74680
- ** happens, the overflow cell is stored in the aBalanceNitroSpace[]
74680
+ ** happens, the overflow cell is stored in the aBalanceQuickSpace[]
74681
74681
  ** buffer.
74682
74682
  **
74683
74683
  ** The purpose of the following assert() is to check that only a
74684
- ** single call to balance_Nitro() is made for each call to this
74684
+ ** single call to balance_quick() is made for each call to this
74685
74685
  ** function. If this were not verified, a subtle bug involving reuse
74686
- ** of the aBalanceNitroSpace[] might sneak in.
74686
+ ** of the aBalanceQuickSpace[] might sneak in.
74687
74687
  */
74688
- assert(balance_Nitro_called == 0);
74689
- VVA_ONLY(balance_Nitro_called++);
74690
- rc = balance_Nitro(pParent, pPage, aBalanceNitroSpace);
74688
+ assert(balance_quick_called == 0);
74689
+ VVA_ONLY(balance_quick_called++);
74690
+ rc = balance_quick(pParent, pPage, aBalanceQuickSpace);
74691
74691
  } else
74692
74692
  #endif
74693
74693
  {
@@ -78755,7 +78755,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe* pVdbe, Mem* pMem) {
78755
78755
  assert((mFlags & (MEM_Int | MEM_IntReal)) == 0 || pMem->u.i == pX->u.i);
78756
78756
 
78757
78757
  /* pMem is the register that is changing. But also mark pX as
78758
- ** undefined so that we can Nitroly detect the shallow-copy error */
78758
+ ** undefined so that we can quickly detect the shallow-copy error */
78759
78759
  pX->flags = MEM_Undefined;
78760
78760
  pX->pScopyFrom = 0;
78761
78761
  }
@@ -109374,12 +109374,12 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse* pParse, Token* pColDef) {
109374
109374
  /* Verify that constraints are still satisfied */
109375
109375
  if (pNew->pCheck != 0 || (pCol->notNull && (pCol->colFlags & COLFLAG_GENERATED) != 0)) {
109376
109376
  sqlite3NestedParse(pParse,
109377
- "SELECT CASE WHEN Nitro_check GLOB 'CHECK*'"
109377
+ "SELECT CASE WHEN quick_check GLOB 'CHECK*'"
109378
109378
  " THEN raise(ABORT,'CHECK constraint failed')"
109379
109379
  " ELSE raise(ABORT,'NOT NULL constraint failed')"
109380
109380
  " END"
109381
- " FROM pragma_Nitro_check(%Q,%Q)"
109382
- " WHERE Nitro_check GLOB 'CHECK*' OR Nitro_check GLOB 'NULL*'",
109381
+ " FROM pragma_quick_check(%Q,%Q)"
109382
+ " WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*'",
109383
109383
  zTab, zDb);
109384
109384
  }
109385
109385
  }
@@ -121707,7 +121707,7 @@ static const struct compareInfo likeInfoAlt = {'%', '_', 0, 0};
121707
121707
  **
121708
121708
  ** The comments within this routine usually assume glob matching.
121709
121709
  **
121710
- ** This routine is usually Nitro, but can be N**2 in the worst case.
121710
+ ** This routine is usually quick, but can be N**2 in the worst case.
121711
121711
  */
121712
121712
  static int patternCompare(const u8* zPattern, /* The glob pattern */
121713
121713
  const u8* zString, /* The string to compare against the glob */
@@ -129896,7 +129896,7 @@ static const PragmaName aPragmaName[] = {
129896
129896
  /* iArg: */ SQLITE_QueryOnly},
129897
129897
  #endif
129898
129898
  #if !defined(SQLITE_OMIT_INTEGRITY_CHECK)
129899
- {/* zName: */ "Nitro_check",
129899
+ {/* zName: */ "quick_check",
129900
129900
  /* ePragTyp: */ PragTyp_INTEGRITY_CHECK,
129901
129901
  /* ePragFlg: */ PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_Result1 | PragFlg_SchemaOpt,
129902
129902
  /* ColNames: */ 0, 0,
@@ -131641,14 +131641,14 @@ SQLITE_PRIVATE void sqlite3Pragma(Parse* pParse, Token* pId1, /* First part of [
131641
131641
  #ifndef SQLITE_OMIT_INTEGRITY_CHECK
131642
131642
  /* PRAGMA integrity_check
131643
131643
  ** PRAGMA integrity_check(N)
131644
- ** PRAGMA Nitro_check
131645
- ** PRAGMA Nitro_check(N)
131644
+ ** PRAGMA quick_check
131645
+ ** PRAGMA quick_check(N)
131646
131646
  **
131647
131647
  ** Verify the integrity of the database.
131648
131648
  **
131649
- ** The "Nitro_check" is reduced version of
131649
+ ** The "quick_check" is reduced version of
131650
131650
  ** integrity_check designed to detect most database corruption
131651
- ** without the overhead of cross-checking indexes. Nitro_check
131651
+ ** without the overhead of cross-checking indexes. Quick_check
131652
131652
  ** is linear time wherease integrity_check is O(NlogN).
131653
131653
  **
131654
131654
  ** The maximum nubmer of errors is 100 by default. A different default
@@ -131667,7 +131667,7 @@ SQLITE_PRIVATE void sqlite3Pragma(Parse* pParse, Token* pId1, /* First part of [
131667
131667
  int i, j, addr, mxErr;
131668
131668
  Table* pObjTab = 0; /* Check only this one table, if not NULL */
131669
131669
 
131670
- int isNitro = (sqlite3Tolower(zLeft[0]) == 'q');
131670
+ int isQuick = (sqlite3Tolower(zLeft[0]) == 'q');
131671
131671
 
131672
131672
  /* If the PRAGMA command was of the form "PRAGMA <db>.integrity_check",
131673
131673
  ** then iDb is set to the index of the database identified by <db>.
@@ -131675,7 +131675,7 @@ SQLITE_PRIVATE void sqlite3Pragma(Parse* pParse, Token* pId1, /* First part of [
131675
131675
  ** the VDBE created below.
131676
131676
  **
131677
131677
  ** Otherwise, if the command was simply "PRAGMA integrity_check" (or
131678
- ** "PRAGMA Nitro_check"), then iDb is set to 0. In this case, set iDb
131678
+ ** "PRAGMA quick_check"), then iDb is set to 0. In this case, set iDb
131679
131679
  ** to -1 here, to indicate that the VDBE should verify the integrity
131680
131680
  ** of all attached databases. */
131681
131681
  assert(iDb >= 0);
@@ -131801,7 +131801,7 @@ SQLITE_PRIVATE void sqlite3Pragma(Parse* pParse, Token* pId1, /* First part of [
131801
131801
  sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0);
131802
131802
  VdbeCoverage(v);
131803
131803
  loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
131804
- if (!isNitro) {
131804
+ if (!isQuick) {
131805
131805
  /* Sanity check on record header decoding */
131806
131806
  sqlite3VdbeAddOp3(v, OP_Column, iDataCur, pTab->nNVCol - 1, 3);
131807
131807
  sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
@@ -131867,7 +131867,7 @@ SQLITE_PRIVATE void sqlite3Pragma(Parse* pParse, Token* pId1, /* First part of [
131867
131867
  }
131868
131868
  sqlite3ExprListDelete(db, pCheck);
131869
131869
  }
131870
- if (!isNitro) { /* Omit the remaining tests for Nitro_check */
131870
+ if (!isQuick) { /* Omit the remaining tests for quick_check */
131871
131871
  /* Validate index entries for the current row */
131872
131872
  for (j = 0, pIdx = pTab->pIndex; pIdx; pIdx = pIdx->pNext, j++) {
131873
131873
  int jmp2, jmp3, jmp4, jmp5;
@@ -131920,7 +131920,7 @@ SQLITE_PRIVATE void sqlite3Pragma(Parse* pParse, Token* pId1, /* First part of [
131920
131920
  sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop);
131921
131921
  VdbeCoverage(v);
131922
131922
  sqlite3VdbeJumpHere(v, loopTop - 1);
131923
- if (!isNitro) {
131923
+ if (!isQuick) {
131924
131924
  sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
131925
131925
  for (j = 0, pIdx = pTab->pIndex; pIdx; pIdx = pIdx->pNext, j++) {
131926
131926
  if (pPk == pIdx)
@@ -146867,7 +146867,7 @@ struct WherePath {
146867
146867
  ** cursor number and column number for X. WhereTerm.eOperator records
146868
146868
  ** the <op> using a bitmask encoding defined by WO_xxx below. The
146869
146869
  ** use of a bitmask encoding for the operator allows us to search
146870
- ** Nitroly for terms that match any of several different operators.
146870
+ ** quickly for terms that match any of several different operators.
146871
146871
  **
146872
146872
  ** A WhereTerm might also be two or more subterms connected by OR:
146873
146873
  **
@@ -155050,7 +155050,7 @@ static int whereLoopAddBtreeIndex(WhereLoopBuilder* pBuilder, /* The WhereLoop f
155050
155050
  ** number of repeats in the left-most terms is at least 18.
155051
155051
  **
155052
155052
  ** The magic number 18 is selected on the basis that scanning 17 rows
155053
- ** is almost always Nitroer than an index seek (even though if the index
155053
+ ** is almost always quicker than an index seek (even though if the index
155054
155054
  ** contains fewer than 2^17 rows we assume otherwise in other parts of
155055
155055
  ** the code). And, even if it is not, it should not be too much slower.
155056
155056
  ** On the other hand, the extra seeks could end up being significantly
@@ -197957,7 +197957,7 @@ static int rtreeBestIndex(sqlite3_vtab* tab, sqlite3_index_info* pIdxInfo) {
197957
197957
 
197958
197958
  /* This strategy involves a two rowid lookups on an B-Tree structures
197959
197959
  ** and then a linear search of an R-Tree node. This should be
197960
- ** considered almost as Nitro as a direct rowid lookup (for which
197960
+ ** considered almost as quick as a direct rowid lookup (for which
197961
197961
  ** sqlite uses an internal cost of 0.0). It is expected to return
197962
197962
  ** a single row.
197963
197963
  */
@@ -55,7 +55,6 @@ SQLiteOperationResult sqliteExecuteBatch(const std::string& dbName, const std::v
55
55
  throw e;
56
56
  }
57
57
  }
58
-
59
58
  sqliteExecuteLiteral(dbName, "COMMIT");
60
59
  return {
61
60
  .rowsAffected = rowsAffected,
@@ -22,12 +22,12 @@ Object.defineProperty(exports, "typeORMDriver", {
22
22
  return _typeORM.typeORMDriver;
23
23
  }
24
24
  });
25
- var _transaction = require("./operations/transaction");
26
- var _nitro = require("./nitro");
27
- var _session = require("./operations/session");
25
+ var _transaction = require("./operations/transaction.js");
26
+ var _nitro = require("./nitro.js");
27
+ var _session = require("./operations/session.js");
28
28
  var _NativeNitroSQLiteOnLoad = _interopRequireDefault(require("./specs/NativeNitroSQLiteOnLoad"));
29
- var _execute = require("./operations/execute");
30
- var _types = require("./types");
29
+ var _execute = require("./operations/execute.js");
30
+ var _types = require("./types.js");
31
31
  Object.keys(_types).forEach(function (key) {
32
32
  if (key === "default" || key === "__esModule") return;
33
33
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -39,7 +39,7 @@ Object.keys(_types).forEach(function (key) {
39
39
  }
40
40
  });
41
41
  });
42
- var _typeORM = require("./typeORM");
42
+ var _typeORM = require("./typeORM.js");
43
43
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
44
44
  const onInitialized = exports.onInitialized = new Promise(resolve => {
45
45
  _NativeNitroSQLiteOnLoad.default.onReactApplicationContextReady(resolve);
@@ -1 +1 @@
1
- {"version":3,"names":["_transaction","require","_nitro","_session","_NativeNitroSQLiteOnLoad","_interopRequireDefault","_execute","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_typeORM","e","__esModule","default","onInitialized","Promise","resolve","NitroSQLiteOnLoad","onReactApplicationContextReady","NitroSQLite","HybridNitroSQLite","native","open","transaction","execute","executeAsync"],"sources":["index.ts"],"sourcesContent":["import { transaction } from './operations/transaction'\nimport { HybridNitroSQLite } from './nitro'\nimport { open } from './operations/session'\nimport NitroSQLiteOnLoad from './specs/NativeNitroSQLiteOnLoad'\nimport { execute, executeAsync } from './operations/execute'\n\nexport * from './types'\nexport { typeORMDriver } from './typeORM'\n\nexport const onInitialized = new Promise<void>((resolve) => {\n NitroSQLiteOnLoad.onReactApplicationContextReady(resolve)\n})\n\nexport const NitroSQLite = {\n ...HybridNitroSQLite,\n native: HybridNitroSQLite,\n onInitialized,\n // Overwrite native functions with session-based JS implementations,\n // where the database name can be ommited once opened\n open,\n transaction,\n execute,\n executeAsync,\n}\n\nexport { open } from './operations/session'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAnB,OAAA;AAAyC,SAAAI,uBAAAgB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElC,MAAMG,aAAa,GAAAR,OAAA,CAAAQ,aAAA,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAK;EAC1DC,gCAAiB,CAACC,8BAA8B,CAACF,OAAO,CAAC;AAC3D,CAAC,CAAC;AAEK,MAAMG,WAAW,GAAAb,OAAA,CAAAa,WAAA,GAAG;EACzB,GAAGC,wBAAiB;EACpBC,MAAM,EAAED,wBAAiB;EACzBN,aAAa;EACb;EACA;EACAQ,IAAI,EAAJA,aAAI;EACJC,WAAW,EAAXA,wBAAW;EACXC,OAAO,EAAPA,gBAAO;EACPC,YAAY,EAAZA;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_transaction","require","_nitro","_session","_NativeNitroSQLiteOnLoad","_interopRequireDefault","_execute","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_typeORM","e","__esModule","default","onInitialized","Promise","resolve","NitroSQLiteOnLoad","onReactApplicationContextReady","NitroSQLite","HybridNitroSQLite","native","open","transaction","execute","executeAsync"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAnB,OAAA;AAAyC,SAAAI,uBAAAgB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElC,MAAMG,aAAa,GAAAR,OAAA,CAAAQ,aAAA,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAK;EAC1DC,gCAAiB,CAACC,8BAA8B,CAACF,OAAO,CAAC;AAC3D,CAAC,CAAC;AAEK,MAAMG,WAAW,GAAAb,OAAA,CAAAa,WAAA,GAAG;EACzB,GAAGC,wBAAiB;EACpBC,MAAM,EAAED,wBAAiB;EACzBN,aAAa;EACb;EACA;EACAQ,IAAI,EAAJA,aAAI;EACJC,WAAW,EAAXA,wBAAW;EACXC,OAAO,EAAPA,gBAAO;EACPC,YAAY,EAAZA;AACF,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeNitroModules","require","HybridNitroSQLite","exports","NitroModules","createHybridObject","locks"],"sources":["nitro.ts"],"sourcesContent":["import { NitroModules } from 'react-native-nitro-modules'\nimport type { NitroSQLite as NitroSQLiteSpec } from './specs/NitroSQLite.nitro'\nimport type { PendingTransaction } from './operations/transaction'\n\nexport const HybridNitroSQLite =\n NitroModules.createHybridObject<NitroSQLiteSpec>('NitroSQLite')\n\nexport const locks: Record<\n string,\n { queue: PendingTransaction[]; inProgress: boolean }\n> = {}\n"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAIO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAC5BE,qCAAY,CAACC,kBAAkB,CAAkB,aAAa,CAAC;AAE1D,MAAMC,KAGZ,GAAAH,OAAA,CAAAG,KAAA,GAAG,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeNitroModules","require","HybridNitroSQLite","exports","NitroModules","createHybridObject","locks"],"sourceRoot":"../../src","sources":["nitro.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAIO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAC5BE,qCAAY,CAACC,kBAAkB,CAAkB,aAAa,CAAC;AAE1D,MAAMC,KAGZ,GAAAH,OAAA,CAAAG,KAAA,GAAG,CAAC,CAAC","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.execute = execute;
7
7
  exports.executeAsync = executeAsync;
8
- var _nitro = require("../nitro");
8
+ var _nitro = require("../nitro.js");
9
9
  function execute(dbName, query, params) {
10
10
  const nativeResult = _nitro.HybridNitroSQLite.execute(dbName, query, params);
11
11
  const result = buildJsQueryResult(nativeResult);
@@ -1 +1 @@
1
- {"version":3,"names":["_nitro","require","execute","dbName","query","params","nativeResult","HybridNitroSQLite","result","buildJsQueryResult","executeAsync","insertId","rowsAffected","results","data","rows","_array","length","item","idx"],"sources":["execute.ts"],"sourcesContent":["import { HybridNitroSQLite } from '../nitro'\nimport type { NativeQueryResult } from '../specs/NativeQueryResult.nitro'\nimport type { QueryResult, SQLiteItem, SQLiteQueryParams } from '../types'\n\nexport function execute<Data extends SQLiteItem = never>(\n dbName: string,\n query: string,\n params?: SQLiteQueryParams\n): QueryResult<Data> {\n const nativeResult = HybridNitroSQLite.execute(dbName, query, params)\n const result = buildJsQueryResult<Data>(nativeResult)\n return result\n}\n\nexport async function executeAsync<Data extends SQLiteItem = never>(\n dbName: string,\n query: string,\n params?: SQLiteQueryParams\n): Promise<QueryResult<Data>> {\n const nativeResult = await HybridNitroSQLite.executeAsync(\n dbName,\n query,\n params\n )\n const result = buildJsQueryResult<Data>(nativeResult)\n return result\n}\n\nfunction buildJsQueryResult<Data extends SQLiteItem = never>({\n insertId,\n rowsAffected,\n results,\n}: NativeQueryResult): QueryResult<Data> {\n const data = results as Data[]\n\n return {\n insertId,\n rowsAffected,\n rows: {\n _array: data,\n length: data.length,\n item: (idx: number) => data[idx],\n },\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIO,SAASC,OAAOA,CACrBC,MAAc,EACdC,KAAa,EACbC,MAA0B,EACP;EACnB,MAAMC,YAAY,GAAGC,wBAAiB,CAACL,OAAO,CAACC,MAAM,EAAEC,KAAK,EAAEC,MAAM,CAAC;EACrE,MAAMG,MAAM,GAAGC,kBAAkB,CAAOH,YAAY,CAAC;EACrD,OAAOE,MAAM;AACf;AAEO,eAAeE,YAAYA,CAChCP,MAAc,EACdC,KAAa,EACbC,MAA0B,EACE;EAC5B,MAAMC,YAAY,GAAG,MAAMC,wBAAiB,CAACG,YAAY,CACvDP,MAAM,EACNC,KAAK,EACLC,MACF,CAAC;EACD,MAAMG,MAAM,GAAGC,kBAAkB,CAAOH,YAAY,CAAC;EACrD,OAAOE,MAAM;AACf;AAEA,SAASC,kBAAkBA,CAAkC;EAC3DE,QAAQ;EACRC,YAAY;EACZC;AACiB,CAAC,EAAqB;EACvC,MAAMC,IAAI,GAAGD,OAAiB;EAE9B,OAAO;IACLF,QAAQ;IACRC,YAAY;IACZG,IAAI,EAAE;MACJC,MAAM,EAAEF,IAAI;MACZG,MAAM,EAAEH,IAAI,CAACG,MAAM;MACnBC,IAAI,EAAGC,GAAW,IAAKL,IAAI,CAACK,GAAG;IACjC;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_nitro","require","execute","dbName","query","params","nativeResult","HybridNitroSQLite","result","buildJsQueryResult","executeAsync","insertId","rowsAffected","results","data","rows","_array","length","item","idx"],"sourceRoot":"../../../src","sources":["operations/execute.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIO,SAASC,OAAOA,CACrBC,MAAc,EACdC,KAAa,EACbC,MAA0B,EACP;EACnB,MAAMC,YAAY,GAAGC,wBAAiB,CAACL,OAAO,CAACC,MAAM,EAAEC,KAAK,EAAEC,MAAM,CAAC;EACrE,MAAMG,MAAM,GAAGC,kBAAkB,CAAOH,YAAY,CAAC;EACrD,OAAOE,MAAM;AACf;AAEO,eAAeE,YAAYA,CAChCP,MAAc,EACdC,KAAa,EACbC,MAA0B,EACE;EAC5B,MAAMC,YAAY,GAAG,MAAMC,wBAAiB,CAACG,YAAY,CACvDP,MAAM,EACNC,KAAK,EACLC,MACF,CAAC;EACD,MAAMG,MAAM,GAAGC,kBAAkB,CAAOH,YAAY,CAAC;EACrD,OAAOE,MAAM;AACf;AAEA,SAASC,kBAAkBA,CAAkC;EAC3DE,QAAQ;EACRC,YAAY;EACZC;AACiB,CAAC,EAAqB;EACvC,MAAMC,IAAI,GAAGD,OAAiB;EAE9B,OAAO;IACLF,QAAQ;IACRC,YAAY;IACZG,IAAI,EAAE;MACJC,MAAM,EAAEF,IAAI;MACZG,MAAM,EAAEH,IAAI,CAACG,MAAM;MACnBC,IAAI,EAAGC,GAAW,IAAKL,IAAI,CAACK,GAAG;IACjC;EACF,CAAC;AACH","ignoreList":[]}
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.close = close;
7
7
  exports.open = open;
8
8
  exports.openDb = openDb;
9
- var _nitro = require("../nitro");
10
- var _transaction = require("./transaction");
11
- var _execute = require("./execute");
9
+ var _nitro = require("../nitro.js");
10
+ var _transaction = require("./transaction.js");
11
+ var _execute = require("./execute.js");
12
12
  function open(options) {
13
13
  openDb(options.name, options.location);
14
14
  return {
@@ -1 +1 @@
1
- {"version":3,"names":["_nitro","require","_transaction","_execute","open","options","openDb","name","location","close","delete","HybridNitroSQLite","drop","attach","dbNameToAttach","alias","detach","transaction","fn","execute","query","params","executeAsync","executeBatch","commands","executeBatchAsync","loadFile","loadFileAsync","dbName","locks","queue","inProgress"],"sources":["session.ts"],"sourcesContent":["import { locks, HybridNitroSQLite } from '../nitro'\nimport { transaction } from './transaction'\nimport type {\n BatchQueryCommand,\n NitroSQLiteConnection,\n NitroSQLiteConnectionOptions,\n QueryResult,\n SQLiteItem,\n SQLiteQueryParams,\n Transaction,\n} from '../types'\nimport { execute, executeAsync } from './execute'\n\nexport function open(\n options: NitroSQLiteConnectionOptions\n): NitroSQLiteConnection {\n openDb(options.name, options.location)\n\n return {\n close: () => close(options.name),\n delete: () => HybridNitroSQLite.drop(options.name, options.location),\n attach: (dbNameToAttach: string, alias: string, location?: string) =>\n HybridNitroSQLite.attach(options.name, dbNameToAttach, alias, location),\n detach: (alias: string) => HybridNitroSQLite.detach(options.name, alias),\n transaction: (fn: (tx: Transaction) => Promise<void> | void) =>\n transaction(options.name, fn),\n execute: <Data extends SQLiteItem = never>(\n query: string,\n params?: SQLiteQueryParams\n ): QueryResult<Data> => execute(options.name, query, params),\n executeAsync: <Data extends SQLiteItem = never>(\n query: string,\n params?: SQLiteQueryParams\n ): Promise<QueryResult<Data>> => executeAsync(options.name, query, params),\n executeBatch: (commands: BatchQueryCommand[]) =>\n HybridNitroSQLite.executeBatch(options.name, commands),\n executeBatchAsync: (commands: BatchQueryCommand[]) =>\n HybridNitroSQLite.executeBatchAsync(options.name, commands),\n loadFile: (location: string) =>\n HybridNitroSQLite.loadFile(options.name, location),\n loadFileAsync: (location: string) =>\n HybridNitroSQLite.loadFileAsync(options.name, location),\n }\n}\n\nexport function openDb(dbName: string, location?: string) {\n HybridNitroSQLite.open(dbName, location)\n\n locks[dbName] = {\n queue: [],\n inProgress: false,\n }\n}\n\nexport function close(dbName: string) {\n HybridNitroSQLite.close(dbName)\n delete locks[dbName]\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,QAAA,GAAAF,OAAA;AAEO,SAASG,IAAIA,CAClBC,OAAqC,EACd;EACvBC,MAAM,CAACD,OAAO,CAACE,IAAI,EAAEF,OAAO,CAACG,QAAQ,CAAC;EAEtC,OAAO;IAC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MAAMA,CAACsB,MAAc,EAAEpB,QAAiB,EAAE;EACxDG,wBAAiB,CAACP,IAAI,CAACwB,MAAM,EAAEpB,QAAQ,CAAC;EAExCqB,YAAK,CAACD,MAAM,CAAC,GAAG;IACdE,KAAK,EAAE,EAAE;IACTC,UAAU,EAAE;EACd,CAAC;AACH;AAEO,SAAStB,KAAKA,CAACmB,MAAc,EAAE;EACpCjB,wBAAiB,CAACF,KAAK,CAACmB,MAAM,CAAC;EAC/B,OAAOC,YAAK,CAACD,MAAM,CAAC;AACtB","ignoreList":[]}
1
+ {"version":3,"names":["_nitro","require","_transaction","_execute","open","options","openDb","name","location","close","delete","HybridNitroSQLite","drop","attach","dbNameToAttach","alias","detach","transaction","fn","execute","query","params","executeAsync","executeBatch","commands","executeBatchAsync","loadFile","loadFileAsync","dbName","locks","queue","inProgress"],"sourceRoot":"../../../src","sources":["operations/session.ts"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,QAAA,GAAAF,OAAA;AAEO,SAASG,IAAIA,CAClBC,OAAqC,EACd;EACvBC,MAAM,CAACD,OAAO,CAACE,IAAI,EAAEF,OAAO,CAACG,QAAQ,CAAC;EAEtC,OAAO;IACLC,KAAK,EAAEA,CAAA,KAAMA,KAAK,CAACJ,OAAO,CAACE,IAAI,CAAC;IAChCG,MAAM,EAAEA,CAAA,KAAMC,wBAAiB,CAACC,IAAI,CAACP,OAAO,CAACE,IAAI,EAAEF,OAAO,CAACG,QAAQ,CAAC;IACpEK,MAAM,EAAEA,CAACC,cAAsB,EAAEC,KAAa,EAAEP,QAAiB,KAC/DG,wBAAiB,CAACE,MAAM,CAACR,OAAO,CAACE,IAAI,EAAEO,cAAc,EAAEC,KAAK,EAAEP,QAAQ,CAAC;IACzEQ,MAAM,EAAGD,KAAa,IAAKJ,wBAAiB,CAACK,MAAM,CAACX,OAAO,CAACE,IAAI,EAAEQ,KAAK,CAAC;IACxEE,WAAW,EAAGC,EAA6C,IACzD,IAAAD,wBAAW,EAACZ,OAAO,CAACE,IAAI,EAAEW,EAAE,CAAC;IAC/BC,OAAO,EAAEA,CACPC,KAAa,EACbC,MAA0B,KACJ,IAAAF,gBAAO,EAACd,OAAO,CAACE,IAAI,EAAEa,KAAK,EAAEC,MAAM,CAAC;IAC5DC,YAAY,EAAEA,CACZF,KAAa,EACbC,MAA0B,KACK,IAAAC,qBAAY,EAACjB,OAAO,CAACE,IAAI,EAAEa,KAAK,EAAEC,MAAM,CAAC;IAC1EE,YAAY,EAAGC,QAA6B,IAC1Cb,wBAAiB,CAACY,YAAY,CAAClB,OAAO,CAACE,IAAI,EAAEiB,QAAQ,CAAC;IACxDC,iBAAiB,EAAGD,QAA6B,IAC/Cb,wBAAiB,CAACc,iBAAiB,CAACpB,OAAO,CAACE,IAAI,EAAEiB,QAAQ,CAAC;IAC7DE,QAAQ,EAAGlB,QAAgB,IACzBG,wBAAiB,CAACe,QAAQ,CAACrB,OAAO,CAACE,IAAI,EAAEC,QAAQ,CAAC;IACpDmB,aAAa,EAAGnB,QAAgB,IAC9BG,wBAAiB,CAACgB,aAAa,CAACtB,OAAO,CAACE,IAAI,EAAEC,QAAQ;EAC1D,CAAC;AACH;AAEO,SAASF,MAAMA,CAACsB,MAAc,EAAEpB,QAAiB,EAAE;EACxDG,wBAAiB,CAACP,IAAI,CAACwB,MAAM,EAAEpB,QAAQ,CAAC;EAExCqB,YAAK,CAACD,MAAM,CAAC,GAAG;IACdE,KAAK,EAAE,EAAE;IACTC,UAAU,EAAE;EACd,CAAC;AACH;AAEO,SAAStB,KAAKA,CAACmB,MAAc,EAAE;EACpCjB,wBAAiB,CAACF,KAAK,CAACmB,MAAM,CAAC;EAC/B,OAAOC,YAAK,CAACD,MAAM,CAAC;AACtB","ignoreList":[]}
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.transaction = void 0;
7
- var _nitro = require("../nitro");
8
- var _execute = require("./execute");
9
- const transaction = async (dbName, fn) => {
7
+ var _nitro = require("../nitro.js");
8
+ var _execute = require("./execute.js");
9
+ const transaction = (dbName, fn) => {
10
10
  if (_nitro.locks[dbName] == null) throw Error(`Nitro SQLite Error: No lock found on db: ${dbName}`);
11
11
  let isFinalized = false;
12
12
 
@@ -59,20 +59,18 @@ const transaction = async (dbName, fn) => {
59
59
  }
60
60
  throw executionError;
61
61
  } finally {
62
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
63
62
  _nitro.locks[dbName].inProgress = false;
64
63
  isFinalized = false;
65
64
  startNextTransaction(dbName);
66
65
  }
67
66
  }
68
67
  return new Promise((resolve, reject) => {
69
- var _locks$dbName;
70
68
  const tx = {
71
69
  start: () => {
72
70
  run().then(resolve).catch(reject);
73
71
  }
74
72
  };
75
- (_locks$dbName = _nitro.locks[dbName]) === null || _locks$dbName === void 0 || _locks$dbName.queue.push(tx);
73
+ _nitro.locks[dbName]?.queue.push(tx);
76
74
  startNextTransaction(dbName);
77
75
  });
78
76
  };
@@ -85,7 +83,6 @@ function startNextTransaction(dbName) {
85
83
  }
86
84
  if (_nitro.locks[dbName].queue.length > 0) {
87
85
  _nitro.locks[dbName].inProgress = true;
88
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
89
86
  const tx = _nitro.locks[dbName].queue.shift();
90
87
  setImmediate(() => {
91
88
  tx.start();
@@ -1 +1 @@
1
- {"version":3,"names":["_nitro","require","_execute","transaction","dbName","fn","locks","Error","isFinalized","executeOnTransaction","query","params","execute","executeAsyncOnTransaction","executeAsync","commit","result","HybridNitroSQLite","rollback","run","executionError","rollbackError","inProgress","startNextTransaction","Promise","resolve","reject","_locks$dbName","tx","start","then","catch","queue","push","exports","length","shift","setImmediate"],"sources":["transaction.ts"],"sourcesContent":["import { locks, HybridNitroSQLite } from '../nitro'\nimport type {\n QueryResult,\n SQLiteItem,\n SQLiteQueryParams,\n Transaction,\n} from '../types'\nimport { execute, executeAsync } from './execute'\n\nexport interface PendingTransaction {\n /*\n * The start function should not throw or return a promise because the\n * queue just calls it and does not monitor for failures or completions.\n *\n * It should catch any errors and call the resolve or reject of the wrapping\n * promise when complete.\n *\n * It should also automatically commit or rollback the transaction if needed\n */\n start: () => void\n}\n\nexport const transaction = async (\n dbName: string,\n fn: (tx: Transaction) => Promise<void> | void\n): Promise<void> => {\n if (locks[dbName] == null)\n throw Error(`Nitro SQLite Error: No lock found on db: ${dbName}`)\n\n let isFinalized = false\n\n // Local transaction context object implementation\n const executeOnTransaction = <Data extends SQLiteItem = never>(\n query: string,\n params?: SQLiteQueryParams\n ): QueryResult<Data> => {\n if (isFinalized) {\n throw Error(\n `Nitro SQLite Error: Cannot execute query on finalized transaction: ${dbName}`\n )\n }\n return execute(dbName, query, params)\n }\n\n const executeAsyncOnTransaction = <Data extends SQLiteItem = never>(\n query: string,\n params?: SQLiteQueryParams\n ): Promise<QueryResult<Data>> => {\n if (isFinalized) {\n throw Error(\n `Nitro SQLite Error: Cannot execute query on finalized transaction: ${dbName}`\n )\n }\n return executeAsync(dbName, query, params)\n }\n\n const commit = () => {\n if (isFinalized) {\n throw Error(\n `Nitro SQLite Error: Cannot execute commit on finalized transaction: ${dbName}`\n )\n }\n const result = HybridNitroSQLite.execute(dbName, 'COMMIT')\n isFinalized = true\n return result\n }\n\n const rollback = () => {\n if (isFinalized) {\n throw Error(\n `Nitro SQLite Error: Cannot execute rollback on finalized transaction: ${dbName}`\n )\n }\n const result = HybridNitroSQLite.execute(dbName, 'ROLLBACK')\n isFinalized = true\n return result\n }\n\n async function run() {\n try {\n await HybridNitroSQLite.executeAsync(dbName, 'BEGIN TRANSACTION')\n\n await fn({\n commit,\n execute: executeOnTransaction,\n executeAsync: executeAsyncOnTransaction,\n rollback,\n })\n\n if (!isFinalized) commit()\n } catch (executionError) {\n if (!isFinalized) {\n try {\n rollback()\n } catch (rollbackError) {\n throw rollbackError\n }\n }\n\n throw executionError\n } finally {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n locks[dbName]!.inProgress = false\n isFinalized = false\n startNextTransaction(dbName)\n }\n }\n\n return new Promise((resolve, reject) => {\n const tx: PendingTransaction = {\n start: () => {\n run().then(resolve).catch(reject)\n },\n }\n\n locks[dbName]?.queue.push(tx)\n startNextTransaction(dbName)\n })\n}\n\nfunction startNextTransaction(dbName: string) {\n if (locks[dbName] == null) throw Error(`Lock not found for db: ${dbName}`)\n\n if (locks[dbName].inProgress) {\n // Transaction is already in process bail out\n return\n }\n\n if (locks[dbName].queue.length > 0) {\n locks[dbName].inProgress = true\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const tx = locks[dbName].queue.shift()!\n setImmediate(() => {\n tx.start()\n })\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,QAAA,GAAAD,OAAA;AAeO,MAAME,WAAW,GAAG,MAAAA,CACzBC,MAAc,EACdC,EAA6C,KAC3B;EAClB,IAAIC,YAAK,CAACF,MAAM,CAAC,IAAI,IAAI,EACvB,MAAMG,KAAK,CAAC,4CAA4CH,MAAM,EAAE,CAAC;EAEnE,IAAII,WAAW,GAAG,KAAK;;EAEvB;EACA,MAAMC,oBAAoB,GAAGA,CAC3BC,KAAa,EACbC,MAA0B,KACJ;IACtB,IAAIH,WAAW,EAAE;MACf,MAAMD,KAAK,CACT,sEAAsEH,MAAM,EAC9E,CAAC;IACH;IACA,OAAO,IAAAQ,gBAAO,EAACR,MAAM,EAAEM,KAAK,EAAEC,MAAM,CAAC;EACvC,CAAC;EAED,MAAME,yBAAyB,GAAGA,CAChCH,KAAa,EACbC,MAA0B,KACK;IAC/B,IAAIH,WAAW,EAAE;MACf,MAAMD,KAAK,CACT,sEAAsEH,MAAM,EAC9E,CAAC;IACH;IACA,OAAO,IAAAU,qBAAY,EAACV,MAAM,EAAEM,KAAK,EAAEC,MAAM,CAAC;EAC5C,CAAC;EAED,MAAMI,MAAM,GAAGA,CAAA,KAAM;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;QACXV,GAAG,CAAC,CAAC,CAACW,IAAI,CAACL,OAAO,CAAC,CAACM,KAAK,CAACL,MAAM,CAAC;MACnC;IACF,CAAC;IAED,CAAAC,aAAA,GAAArB,YAAK,CAACF,MAAM,CAAC,cAAAuB,aAAA,eAAbA,aAAA,CAAeK,KAAK,CAACC,IAAI,CAACL,EAAE,CAAC;IAC7BL,oBAAoB,CAACnB,MAAM,CAAC;EAC9B,CAAC,CAAC;AACJ,CAAC;AAAA8B,OAAA,CAAA/B,WAAA,GAAAA,WAAA;AAED,SAASoB,oBAAoBA,CAACnB,MAAc,EAAE;EAC5C,IAAIE,YAAK,CAACF,MAAM,CAAC,IAAI,IAAI,EAAE,MAAMG,KAAK,CAAC,0BAA0BH,MAAM,EAAE,CAAC;EAE1E,IAAIE,YAAK,CAACF,MAAM,CAAC,CAACkB,UAAU,EAAE;IAC5B;IACA;EACF;EAEA,IAAIhB,YAAK,CAACF,MAAM,CAAC,CAAC4B,KAAK,CAACG,MAAM,GAAG,CAAC,EAAE;IAClC7B,YAAK,CAACF,MAAM,CAAC,CAACkB,UAAU,GAAG,IAAI;IAC/B;IACA,MAAMM,EAAE,GAAGtB,YAAK,CAACF,MAAM,CAAC,CAAC4B,KAAK,CAACI,KAAK,CAAC,CAAE;IACvCC,YAAY,CAAC,MAAM;MACjBT,EAAE,CAACC,KAAK,CAAC,CAAC;IACZ,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_nitro","require","_execute","transaction","dbName","fn","locks","Error","isFinalized","executeOnTransaction","query","params","execute","executeAsyncOnTransaction","executeAsync","commit","result","HybridNitroSQLite","rollback","run","executionError","rollbackError","inProgress","startNextTransaction","Promise","resolve","reject","tx","start","then","catch","queue","push","exports","length","shift","setImmediate"],"sourceRoot":"../../../src","sources":["operations/transaction.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,QAAA,GAAAD,OAAA;AAeO,MAAME,WAAW,GAAGA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E;IAClC5B,YAAK,CAACF,MAAM,CAAC,CAACkB,UAAU,GAAG,IAAI;IAE/B,MAAMK,EAAE,GAAGrB,YAAK,CAACF,MAAM,CAAC,CAAC2B,KAAK,CAACI,KAAK,CAAC,CAAE;IACvCC,YAAY,CAAC,MAAM;MACjBT,EAAE,CAACC,KAAK,CAAC,CAAC;IACZ,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["noop","exports","onReactApplicationContextReady","undefined","_default","default"],"sources":["NativeNitroSQLiteOnLoad.ios.ts"],"sourcesContent":["import type { Spec as AndroidOnLoadTurboModuleSpec } from './NativeNitroSQLiteOnLoad'\n\nexport const noop: AndroidOnLoadTurboModuleSpec = {\n onReactApplicationContextReady: () => undefined,\n}\n\nexport default noop\n"],"mappings":";;;;;;AAEO,MAAMA,IAAkC,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAChDE,8BAA8B,EAAEA,CAAA,KAAMC;AACxC,CAAC;AAAA,IAAAC,QAAA,GAAAH,OAAA,CAAAI,OAAA,GAEcL,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["noop","exports","onReactApplicationContextReady","undefined","_default","default"],"sourceRoot":"../../../src","sources":["specs/NativeNitroSQLiteOnLoad.ios.ts"],"mappings":";;;;;;AAEO,MAAMA,IAAkC,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAChDE,8BAA8B,EAAEA,CAAA,KAAMC;AACxC,CAAC;AAAA,IAAAC,QAAA,GAAAH,OAAA,CAAAI,OAAA,GAEcL,IAAI","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sources":["NativeNitroSQLiteOnLoad.ts"],"sourcesContent":["import { TurboModuleRegistry, type TurboModule } from 'react-native'\n\nexport interface Spec extends TurboModule {\n onReactApplicationContextReady(callback: () => void): void\n}\n\nexport default TurboModuleRegistry.getEnforcing<Spec>('RNNitroSQLiteOnLoad')\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAoE,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMrDC,gCAAmB,CAACC,YAAY,CAAO,qBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeNitroSQLiteOnLoad.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAoE,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMrDC,gCAAmB,CAACC,YAAY,CAAO,qBAAqB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["NativeQueryResult.nitro.ts"],"sourcesContent":["import type { HybridObject } from 'react-native-nitro-modules'\nimport type { ColumnType, SQLiteValue } from '../types'\n\n/**\n * Object returned by SQL Query executions {\n * insertId: Represent the auto-generated row id if applicable\n * rowsAffected: Number of affected rows if result of a update query\n * message: if status === 1, here you will find error description\n * rows: if status is undefined or 0 this object will contain the query results\n * }\n *\n * @interface NativeQueryResult\n */\nexport interface NativeQueryResult\n extends HybridObject<{ ios: 'c++'; android: 'c++' }> {\n readonly rowsAffected: number\n readonly insertId?: number\n\n /** Query results */\n readonly results: SQLiteQueryResults\n /** Table metadata */\n readonly metadata?: Record<string, SQLiteQueryColumnMetadata>\n}\n\n/**\n * Table metadata\n * Describes some information about the table and it's columns fetched by the query\n * The index is the name of the column\n */\n// TODO: Investigate why this doesn't work with nitrogen\n// export type SQLiteQueryResultRow = Record<string, SQLiteValue>\n// export type SQLiteQueryResults = SQLiteQueryResultRow[]\nexport type SQLiteQueryResults = Record<string, SQLiteValue>[]\n\n// TODO: Investigate why this doesn't work with nitrogen\n// export type SQLiteQueryTableMetadata = Record<string, SQLiteQueryColumnMetadata>\nexport interface SQLiteQueryColumnMetadata {\n /** The name used for this column for this result set */\n name: string\n /** 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. */\n type: ColumnType\n /** The index for this column for this result set */\n index: number\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NativeQueryResult.nitro.ts"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["NitroSQLite.nitro.ts"],"sourcesContent":["import type { HybridObject } from 'react-native-nitro-modules'\nimport type {\n BatchQueryResult,\n FileLoadResult,\n BatchQueryCommand,\n SQLiteQueryParams,\n} from '../types'\nimport type { NativeQueryResult } from './NativeQueryResult.nitro'\n\nexport interface NitroSQLite\n extends HybridObject<{ ios: 'c++'; android: 'c++' }> {\n open(dbName: string, location?: string): void\n close(dbName: string): void\n drop(dbName: string, location?: string): void\n attach(\n mainDbName: string,\n dbNameToAttach: string,\n alias: string,\n location?: string\n ): void\n detach(mainDbName: string, alias: string): void\n execute(\n dbName: string,\n query: string,\n params?: SQLiteQueryParams\n ): NativeQueryResult\n executeAsync(\n dbName: string,\n query: string,\n params?: SQLiteQueryParams\n ): Promise<NativeQueryResult>\n executeBatch(dbName: string, commands: BatchQueryCommand[]): BatchQueryResult\n executeBatchAsync(\n dbName: string,\n commands: BatchQueryCommand[]\n ): Promise<BatchQueryResult>\n loadFile(dbName: string, location: string): FileLoadResult\n loadFileAsync(dbName: string, location: string): Promise<FileLoadResult>\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NitroSQLite.nitro.ts"],"mappings":"","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.typeORMDriver = void 0;
7
- var Operations = _interopRequireWildcard(require("./operations/session"));
7
+ var Operations = _interopRequireWildcard(require("./operations/session.js"));
8
8
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
9
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
10
  // _________ _______ ______ ____ _____ __ __ _____ _____
@@ -1 +1 @@
1
- {"version":3,"names":["Operations","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","typeORMDriver","exports","openDatabase","options","ok","fail","db","open","connection","executeSql","sql","params","okExecute","failExecute","result","executeAsync","transaction","fn","close","okClose","failClose","attach","dbNameToAttach","alias","location","callback","detach"],"sources":["typeORM.ts"],"sourcesContent":["// _________ _______ ______ ____ _____ __ __ _____ _____\n// |__ __\\ \\ / / __ \\| ____/ __ \\| __ \\| \\/ | /\\ | __ \\_ _|\n// | | \\ \\_/ /| |__) | |__ | | | | |__) | \\ / | / \\ | |__) || |\n// | | \\ / | ___/| __|| | | | _ /| |\\/| | / /\\ \\ | ___/ | |\n// | | | | | | | |___| |__| | | \\ \\| | | | / ____ \\| | _| |_\n// |_| |_| |_| |______\\____/|_| \\_\\_| |_| /_/ \\_\\_| |_____|\n\nimport type {\n QueryResult,\n SQLiteItem,\n SQLiteQueryParams,\n Transaction,\n} from './types'\nimport * as Operations from './operations/session'\n\ninterface TypeOrmNitroSQLiteConnection {\n executeSql: <RowData extends SQLiteItem = never>(\n sql: string,\n params: SQLiteQueryParams | undefined,\n okExecute: (res: QueryResult<RowData>) => void,\n failExecute: (msg: string) => void\n ) => Promise<void>\n transaction: (fn: (tx: Transaction) => Promise<void>) => Promise<void>\n close: (okClose: () => void, failClose: (e: unknown) => void) => void\n attach: (\n dbNameToAttach: string,\n alias: string,\n location: string | undefined,\n callback: () => void\n ) => void\n detach: (alias: string, callback: () => void) => void\n}\n\n/**\n * DO NOT USE THIS! THIS IS MEANT FOR TYPEORM\n * If you are looking for a convenience wrapper use `connect`\n */\nexport const typeORMDriver = {\n openDatabase: (\n options: {\n name: string\n location?: string\n },\n ok: (db: TypeOrmNitroSQLiteConnection) => void,\n fail: (msg: string) => void\n ): TypeOrmNitroSQLiteConnection | null => {\n try {\n const db = Operations.open(options)\n\n const connection: TypeOrmNitroSQLiteConnection = {\n executeSql: async <RowData extends SQLiteItem = never>(\n sql: string,\n params: SQLiteQueryParams | undefined,\n okExecute: (res: QueryResult<RowData>) => void,\n failExecute: (msg: string) => void\n ) => {\n try {\n const result = await db.executeAsync<RowData>(sql, params)\n okExecute(result)\n } catch (e: unknown) {\n failExecute(e as string)\n }\n },\n transaction: (\n fn: (tx: Transaction) => Promise<void>\n ): Promise<void> => {\n return db.transaction(fn)\n },\n close: (okClose: () => void, failClose: (e: unknown) => void) => {\n try {\n db.close()\n okClose()\n } catch (e) {\n failClose(e)\n }\n },\n attach: (\n dbNameToAttach: string,\n alias: string,\n location: string | undefined,\n callback: () => void\n ) => {\n db.attach(dbNameToAttach, alias, location)\n callback()\n },\n detach: (alias: string, callback: () => void) => {\n db.detach(alias)\n callback()\n },\n }\n\n ok(connection)\n\n return connection\n } catch (e: unknown) {\n fail(e as string)\n\n return null\n }\n },\n}\n"],"mappings":";;;;;;AAaA,IAAAA,UAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SA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C,WAAkC,KAC/B;UACH,IAAI;YACF,MAAMC,MAAM,GAAG,MAAMR,EAAE,CAACS,YAAY,CAAUL,GAAG,EAAEC,MAAM,CAAC;YAC1DC,SAAS,CAACE,MAAM,CAAC;UACnB,CAAC,CAAC,OAAOjC,CAAU,EAAE;YACnBgC,WAAW,CAAChC,CAAW,CAAC;UAC1B;QACF,CAAC;QACDmC,WAAW,EACTC,EAAsC,IACpB;UAClB,OAAOX,EAAE,CAACU,WAAW,CAACC,EAAE,CAAC;QAC3B,CAAC;QACDC,KAAK,EAAEA,CAACC,OAAmB,EAAEC,SAA+B,KAAK;UAC/D,IAAI;YACFd,EAAE,CAACY,KAAK,CAAC,CAAC;YACVC,OAAO,CAAC,CAAC;UACX,CAAC,CAAC,OAAOtC,CAAC,EAAE;YACVuC,SAAS,CAACvC,CAAC,CAAC;UACd;QACF,CAAC;QACDwC,MAAM,EAAEA,CACNC,cAAsB,EACtBC,KAAa,EACbC,QAA4B,EAC5BC,QAAoB,KACjB;UACHnB,EAAE,CAACe,MAAM,CAACC,cAAc,EAAEC,KAAK,EAAEC,QAAQ,CAAC;UAC1CC,QAAQ,CAAC,CAAC;QACZ,CAAC;QACDC,MAAM,EAAEA,CAACH,KAAa,EAAEE,QAAoB,KAAK;UAC/CnB,EAAE,CAACoB,MAAM,CAACH,KAAK,CAAC;UAChBE,QAAQ,CAAC,CAAC;QACZ;MACF,CAAC;MAEDrB,EAAE,CAACI,UAAU,CAAC;MAEd,OAAOA,UAAU;IACnB,CAAC,CAAC,OAAO3B,CAAU,EAAE;MACnBwB,IAAI,CAACxB,CAAW,CAAC;MAEjB,OAAO,IAAI;IACb;EACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Operations","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","typeORMDriver","exports","openDatabase","options","ok","fail","db","open","connection","executeSql","sql","params","okExecute","failExecute","result","executeAsync","transaction","fn","close","okClose","failClose","attach","dbNameToAttach","alias","location","callback","detach"],"sourceRoot":"../../src","sources":["typeORM.ts"],"mappings":";;;;;;AAaA,IAAAA,UAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,G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AC;MAEDrB,EAAE,CAACI,UAAU,CAAC;MAEd,OAAOA,UAAU;IACnB,CAAC,CAAC,OAAO3B,CAAU,EAAE;MACnBwB,IAAI,CAACxB,CAAW,CAAC;MAEjB,OAAO,IAAI;IACb;EACF;AACF,CAAC","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ColumnType = void 0;
7
- // eslint-disable-next-line no-restricted-syntax
8
7
  let ColumnType = exports.ColumnType = /*#__PURE__*/function (ColumnType) {
9
8
  ColumnType[ColumnType["BOOLEAN"] = 0] = "BOOLEAN";
10
9
  ColumnType[ColumnType["NUMBER"] = 1] = "NUMBER";
@@ -1 +1 @@
1
- {"version":3,"names":["ColumnType","exports"],"sources":["types.ts"],"sourcesContent":["export interface NitroSQLiteConnectionOptions {\n name: string\n location?: string\n}\n\nexport interface NitroSQLiteConnection {\n close(): void\n delete(): void\n attach(dbNameToAttach: string, alias: string, location?: string): void\n detach(alias: string): void\n transaction(fn: (tx: Transaction) => Promise<void> | void): Promise<void>\n execute: ExecuteQuery\n executeAsync: ExecuteAsyncQuery\n executeBatch(commands: BatchQueryCommand[]): BatchQueryResult\n executeBatchAsync(commands: BatchQueryCommand[]): Promise<BatchQueryResult>\n loadFile(location: string): FileLoadResult\n loadFileAsync(location: string): Promise<FileLoadResult>\n}\n\n// eslint-disable-next-line no-restricted-syntax\nexport enum ColumnType {\n BOOLEAN,\n NUMBER,\n INT64,\n TEXT,\n ARRAY_BUFFER,\n NULL_VALUE,\n}\n\n/**\n * Represents a value that can be stored in a SQLite database\n */\nexport type SQLiteValue =\n | boolean\n | number\n | bigint\n | string\n | ArrayBuffer\n | undefined\n\nexport type SQLiteItem = Record<string, SQLiteValue>\n\nexport interface QueryResult<RowData extends SQLiteItem = SQLiteItem> {\n readonly insertId?: number\n readonly rowsAffected: number\n\n readonly rows?: {\n /** Raw array with all dataset */\n _array: RowData[]\n /** The lengh of the dataset */\n length: number\n /** A convenience function to acess the index based the row object\n * @param idx the row index\n * @returns the row structure identified by column names\n */\n item: (idx: number) => RowData | undefined\n }\n}\n\nexport type SQLiteQueryParams = SQLiteValue[]\n\nexport type ExecuteQuery = <RowData extends SQLiteItem = SQLiteItem>(\n query: string,\n params?: SQLiteQueryParams\n) => QueryResult<RowData>\n\nexport type ExecuteAsyncQuery = <RowData extends SQLiteItem = SQLiteItem>(\n query: string,\n params?: SQLiteQueryParams\n) => Promise<QueryResult<RowData>>\n\nexport interface Transaction {\n commit(): QueryResult\n rollback(): QueryResult\n execute: ExecuteQuery\n executeAsync: ExecuteAsyncQuery\n}\n\n/**\n * Allows the execution of bulk of sql commands\n * inside a transaction\n * If a single query must be executed many times with different arguments, its preferred\n * to declare it a single time, and use an array of array parameters.\n */\nexport interface BatchQueryCommand {\n query: string\n params?: SQLiteQueryParams | SQLiteQueryParams[]\n}\n\n/**\n * status: 0 or undefined for correct execution, 1 for error\n * message: if status === 1, here you will find error description\n * rowsAffected: Number of affected rows if status == 0\n */\nexport interface BatchQueryResult {\n rowsAffected?: number\n}\n\n/**\n * Result of loading a file and executing every line as a SQL command\n * Similar to BatchQueryResult\n */\nexport interface FileLoadResult extends BatchQueryResult {\n commands?: number\n}\n"],"mappings":";;;;;;AAmBA;AAAA,IACYA,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;AAStB;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["ColumnType","exports"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;;;;;IAmBYA,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;AAStB;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,10 +1,12 @@
1
- import { transaction } from './operations/transaction';
2
- import { HybridNitroSQLite } from './nitro';
3
- import { open } from './operations/session';
1
+ "use strict";
2
+
3
+ import { transaction } from "./operations/transaction.js";
4
+ import { HybridNitroSQLite } from "./nitro.js";
5
+ import { open } from "./operations/session.js";
4
6
  import NitroSQLiteOnLoad from './specs/NativeNitroSQLiteOnLoad';
5
- import { execute, executeAsync } from './operations/execute';
6
- export * from './types';
7
- export { typeORMDriver } from './typeORM';
7
+ import { execute, executeAsync } from "./operations/execute.js";
8
+ export * from "./types.js";
9
+ export { typeORMDriver } from "./typeORM.js";
8
10
  export const onInitialized = new Promise(resolve => {
9
11
  NitroSQLiteOnLoad.onReactApplicationContextReady(resolve);
10
12
  });
@@ -19,5 +21,5 @@ export const NitroSQLite = {
19
21
  execute,
20
22
  executeAsync
21
23
  };
22
- export { open } from './operations/session';
24
+ export { open } from "./operations/session.js";
23
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["transaction","HybridNitroSQLite","open","NitroSQLiteOnLoad","execute","executeAsync","typeORMDriver","onInitialized","Promise","resolve","onReactApplicationContextReady","NitroSQLite","native"],"sources":["index.ts"],"sourcesContent":["import { transaction } from './operations/transaction'\nimport { HybridNitroSQLite } from './nitro'\nimport { open } from './operations/session'\nimport NitroSQLiteOnLoad from './specs/NativeNitroSQLiteOnLoad'\nimport { execute, executeAsync } from './operations/execute'\n\nexport * from './types'\nexport { typeORMDriver } from './typeORM'\n\nexport const onInitialized = new Promise<void>((resolve) => {\n NitroSQLiteOnLoad.onReactApplicationContextReady(resolve)\n})\n\nexport const NitroSQLite = {\n ...HybridNitroSQLite,\n native: HybridNitroSQLite,\n onInitialized,\n // Overwrite native functions with session-based JS implementations,\n // where the database name can be ommited once opened\n open,\n transaction,\n execute,\n executeAsync,\n}\n\nexport { open } from './operations/session'\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,IAAI,QAAQ,sBAAsB;AAC3C,OAAOC,iBAAiB,MAAM,iCAAiC;AAC/D,SAASC,OAAO,EAAEC,YAAY,QAAQ,sBAAsB;AAE5D,cAAc,SAAS;AACvB,SAASC,aAAa,QAAQ,WAAW;AAEzC,OAAO,MAAMC,aAAa,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAK;EAC1DN,iBAAiB,CAACO,8BAA8B,CAACD,OAAO,CAAC;AAC3D,CAAC,CAAC;AAEF,OAAO,MAAME,WAAW,GAAG;EACzB,GAAGV,iBAAiB;EACpBW,MAAM,EAAEX,iBAAiB;EACzBM,aAAa;EACb;EACA;EACAL,IAAI;EACJF,WAAW;EACXI,OAAO;EACPC;AACF,CAAC;AAED,SAASH,IAAI,QAAQ,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["transaction","HybridNitroSQLite","open","NitroSQLiteOnLoad","execute","executeAsync","typeORMDriver","onInitialized","Promise","resolve","onReactApplicationContextReady","NitroSQLite","native"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,6BAA0B;AACtD,SAASC,iBAAiB,QAAQ,YAAS;AAC3C,SAASC,IAAI,QAAQ,yBAAsB;AAC3C,OAAOC,iBAAiB,MAAM,iCAAiC;AAC/D,SAASC,OAAO,EAAEC,YAAY,QAAQ,yBAAsB;AAE5D,cAAc,YAAS;AACvB,SAASC,aAAa,QAAQ,cAAW;AAEzC,OAAO,MAAMC,aAAa,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAK;EAC1DN,iBAAiB,CAACO,8BAA8B,CAACD,OAAO,CAAC;AAC3D,CAAC,CAAC;AAEF,OAAO,MAAME,WAAW,GAAG;EACzB,GAAGV,iBAAiB;EACpBW,MAAM,EAAEX,iBAAiB;EACzBM,aAAa;EACb;EACA;EACAL,IAAI;EACJF,WAAW;EACXI,OAAO;EACPC;AACF,CAAC;AAED,SAASH,IAAI,QAAQ,yBAAsB","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  import { NitroModules } from 'react-native-nitro-modules';
2
4
  export const HybridNitroSQLite = NitroModules.createHybridObject('NitroSQLite');
3
5
  export const locks = {};
@@ -1 +1 @@
1
- {"version":3,"names":["NitroModules","HybridNitroSQLite","createHybridObject","locks"],"sources":["nitro.ts"],"sourcesContent":["import { NitroModules } from 'react-native-nitro-modules'\nimport type { NitroSQLite as NitroSQLiteSpec } from './specs/NitroSQLite.nitro'\nimport type { PendingTransaction } from './operations/transaction'\n\nexport const HybridNitroSQLite =\n NitroModules.createHybridObject<NitroSQLiteSpec>('NitroSQLite')\n\nexport const locks: Record<\n string,\n { queue: PendingTransaction[]; inProgress: boolean }\n> = {}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAIzD,OAAO,MAAMC,iBAAiB,GAC5BD,YAAY,CAACE,kBAAkB,CAAkB,aAAa,CAAC;AAEjE,OAAO,MAAMC,KAGZ,GAAG,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NitroModules","HybridNitroSQLite","createHybridObject","locks"],"sourceRoot":"../../src","sources":["nitro.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAIzD,OAAO,MAAMC,iBAAiB,GAC5BD,YAAY,CAACE,kBAAkB,CAAkB,aAAa,CAAC;AAEjE,OAAO,MAAMC,KAGZ,GAAG,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,6 @@
1
- import { HybridNitroSQLite } from '../nitro';
1
+ "use strict";
2
+
3
+ import { HybridNitroSQLite } from "../nitro.js";
2
4
  export function execute(dbName, query, params) {
3
5
  const nativeResult = HybridNitroSQLite.execute(dbName, query, params);
4
6
  const result = buildJsQueryResult(nativeResult);