expo-sqlite 58.0.10 → 58.0.11

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 (72) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/android/build.gradle +6 -2
  3. package/android/src/main/cpp/NativeDatabaseBinding.cpp +11 -8
  4. package/android/src/main/cpp/NativeStatementBinding.cpp +43 -2
  5. package/android/src/main/cpp/NativeStatementBinding.h +3 -0
  6. package/android/src/main/cpp/SQLiteError.h +34 -0
  7. package/android/src/main/java/expo/modules/sqlite/DatabaseConnection.kt +68 -0
  8. package/android/src/main/java/expo/modules/sqlite/NativeDatabase.kt +135 -22
  9. package/android/src/main/java/expo/modules/sqlite/NativeSession.kt +126 -6
  10. package/android/src/main/java/expo/modules/sqlite/NativeStatement.kt +199 -14
  11. package/android/src/main/java/expo/modules/sqlite/NativeStatementBinding.kt +1 -0
  12. package/android/src/main/java/expo/modules/sqlite/SQLRecords.kt +19 -13
  13. package/android/src/main/java/expo/modules/sqlite/SQLiteModule.kt +176 -577
  14. package/android/src/main/java/expo/modules/sqlite/SQLiteOptions.kt +3 -10
  15. package/android/src/main/java/expo/modules/sqlite/SQLiteValues.kt +47 -0
  16. package/build/NativeDatabase.d.ts +2 -2
  17. package/build/SQLiteDatabase.js +9 -3
  18. package/build/SQLiteDatabase.js.map +1 -1
  19. package/dev-plugin-dist/+not-found.html +1 -1
  20. package/dev-plugin-dist/_expo/static/js/web/{__common-9b94dd2fbdbb825a662f42cf8d2077ee.js → __common-8b6d10c7ab64ecfd128d45105ef5590b.js} +51 -48
  21. package/dev-plugin-dist/_expo/static/js/web/{_layout-b2894030c1dfbd95b717a85901b6c271.js → _layout-1da259c4109daa50bd04899675f5d333.js} +23 -23
  22. package/dev-plugin-dist/_expo/static/js/web/{entry-04fdb7d857a65c0ed638ef2d774a4b6e.js → entry-5e24130038c41e25d9a78d08664ef6cb.js} +753 -753
  23. package/dev-plugin-dist/_expo/static/js/web/{index-4bf2da199f699eb47a42074d5e183c07.js → index-17ca77580cae7c249688c43b3b3e0949.js} +1740 -1740
  24. package/dev-plugin-dist/_expo/static/js/web/{worker-d51aa6be89e271e571111274ab8e7f5c.js → worker-cc2e40fb110f53b73733dd7e24d9d8f6.js} +17 -17
  25. package/dev-plugin-dist/_sitemap.html +1 -1
  26. package/dev-plugin-dist/index.html +1 -1
  27. package/expo-module.config.json +0 -1
  28. package/ios/NativeDatabase.swift +5 -8
  29. package/ios/NativeStatement.swift +20 -13
  30. package/ios/SQLiteResult.swift +31 -0
  31. package/ios/Tests/test_ErrorReporting.swift +25 -0
  32. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11-sources.jar +0 -0
  33. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11-sources.jar.md5 +1 -0
  34. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11-sources.jar.sha1 +1 -0
  35. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11-sources.jar.sha256 +1 -0
  36. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11-sources.jar.sha512 +1 -0
  37. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.aar +0 -0
  38. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.aar.md5 +1 -0
  39. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.aar.sha1 +1 -0
  40. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.aar.sha256 +1 -0
  41. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.aar.sha512 +1 -0
  42. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{58.0.10/expo.modules.sqlite-58.0.10.module → 58.0.11/expo.modules.sqlite-58.0.11.module} +22 -22
  43. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.module.md5 +1 -0
  44. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.module.sha1 +1 -0
  45. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.module.sha256 +1 -0
  46. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.module.sha512 +1 -0
  47. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{58.0.10/expo.modules.sqlite-58.0.10.pom → 58.0.11/expo.modules.sqlite-58.0.11.pom} +1 -1
  48. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.pom.md5 +1 -0
  49. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.pom.sha1 +1 -0
  50. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.pom.sha256 +1 -0
  51. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.11/expo.modules.sqlite-58.0.11.pom.sha512 +1 -0
  52. package/package.json +4 -4
  53. package/src/NativeDatabase.ts +2 -2
  54. package/src/SQLiteDatabase.ts +11 -3
  55. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar +0 -0
  56. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar.md5 +0 -1
  57. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar.sha1 +0 -1
  58. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar.sha256 +0 -1
  59. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar.sha512 +0 -1
  60. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar +0 -0
  61. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar.md5 +0 -1
  62. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar.sha1 +0 -1
  63. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar.sha256 +0 -1
  64. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar.sha512 +0 -1
  65. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.module.md5 +0 -1
  66. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.module.sha1 +0 -1
  67. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.module.sha256 +0 -1
  68. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.module.sha512 +0 -1
  69. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.pom.md5 +0 -1
  70. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.pom.sha1 +0 -1
  71. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.pom.sha256 +0 -1
  72. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.pom.sha512 +0 -1
@@ -314,5 +314,5 @@ input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-web
314
314
  @keyframes r-imtty0{0%{opacity:0;}100%{opacity:1;}}
315
315
  @keyframes r-q67da2{0%{transform:translateX(-100%);}100%{transform:translateX(400%);}}
316
316
  @keyframes r-t2lo5v{0%{opacity:1;}100%{opacity:0;}}</style><script type="module">globalThis.__EXPO_ROUTER_HYDRATE__=true;</script><link rel="preload" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css" as="style">
317
- <link rel="stylesheet" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css"></head><body><div id="root"><div class="css-g5y9jx r-13awgt0"></div></div><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/_layout-b2894030c1dfbd95b717a85901b6c271.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__common-9b94dd2fbdbb825a662f42cf8d2077ee.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/entry-04fdb7d857a65c0ed638ef2d774a4b6e.js" defer></script>
317
+ <link rel="stylesheet" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css"></head><body><div id="root"><div class="css-g5y9jx r-13awgt0"></div></div><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/_layout-1da259c4109daa50bd04899675f5d333.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__common-8b6d10c7ab64ecfd128d45105ef5590b.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/entry-5e24130038c41e25d9a78d08664ef6cb.js" defer></script>
318
318
  </body></html>
@@ -314,5 +314,5 @@ input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-web
314
314
  @keyframes r-imtty0{0%{opacity:0;}100%{opacity:1;}}
315
315
  @keyframes r-q67da2{0%{transform:translateX(-100%);}100%{transform:translateX(400%);}}
316
316
  @keyframes r-t2lo5v{0%{opacity:1;}100%{opacity:0;}}</style><script type="module">globalThis.__EXPO_ROUTER_HYDRATE__=true;</script><link rel="preload" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css" as="style">
317
- <link rel="stylesheet" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css"></head><body><div id="root"><div class="css-g5y9jx r-13awgt0"><!--$--><!--$--><div class="flex min-h-screen items-center justify-center bg-linear-to-br from-slate-50 to-slate-100 p-4"><div class="rounded-xl border bg-card text-card-foreground shadow w-full max-w-2xl"><div class="flex flex-col space-y-1.5 p-6 text-center"><div class="font-semibold tracking-tight text-3xl">SQLite Database Inspector</div><div class="text-muted-foreground text-base">Upload a database file or connect to your app</div></div><div class="p-6 pt-0"><div dir="ltr" data-orientation="horizontal" class="w-full"><div role="tablist" aria-orientation="horizontal" class="h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground grid w-full grid-cols-2" tabindex="-1" data-orientation="horizontal" style="outline:none"><button type="button" role="tab" aria-selected="true" aria-controls="radix-_R_jer3_-content-devtools" data-state="active" data-disabled="" disabled="" id="radix-_R_jer3_-trigger-devtools" class="inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow" tabindex="-1" data-orientation="horizontal" data-radix-collection-item="">From App </button><button type="button" role="tab" aria-selected="false" aria-controls="radix-_R_jer3_-content-upload" data-state="inactive" id="radix-_R_jer3_-trigger-upload" class="inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow" tabindex="-1" data-orientation="horizontal" data-radix-collection-item="">Upload File</button></div><div data-state="inactive" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-_R_jer3_-trigger-upload" hidden="" id="radix-_R_jer3_-content-upload" tabindex="0" class="mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"></div><div data-state="active" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-_R_jer3_-trigger-devtools" id="radix-_R_jer3_-content-devtools" tabindex="0" class="mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2" style="animation-duration:0s"><div class="space-y-4"><div class="flex items-center justify-between"><h3 class="text-sm font-medium">Available Databases</h3><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-8 rounded-md px-3 text-xs"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw h-4 w-4 mr-2" aria-hidden="true"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"></path><path d="M8 16H3v5"></path></svg>Refresh</button></div><div class="text-center p-12 rounded-lg border-2 border-dashed border-muted-foreground/25"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database h-12 w-12 text-muted-foreground mx-auto mb-4" aria-hidden="true"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><p class="text-sm text-muted-foreground">No databases found. Make sure your app is using useSQLiteDevTool.</p></div></div></div></div></div></div></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><!--/$--><!--/$--></div></div><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/_layout-b2894030c1dfbd95b717a85901b6c271.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/index-4bf2da199f699eb47a42074d5e183c07.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__common-9b94dd2fbdbb825a662f42cf8d2077ee.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/entry-04fdb7d857a65c0ed638ef2d774a4b6e.js" defer></script>
317
+ <link rel="stylesheet" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css"></head><body><div id="root"><div class="css-g5y9jx r-13awgt0"><!--$--><!--$--><div class="flex min-h-screen items-center justify-center bg-linear-to-br from-slate-50 to-slate-100 p-4"><div class="rounded-xl border bg-card text-card-foreground shadow w-full max-w-2xl"><div class="flex flex-col space-y-1.5 p-6 text-center"><div class="font-semibold tracking-tight text-3xl">SQLite Database Inspector</div><div class="text-muted-foreground text-base">Upload a database file or connect to your app</div></div><div class="p-6 pt-0"><div dir="ltr" data-orientation="horizontal" class="w-full"><div role="tablist" aria-orientation="horizontal" class="h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground grid w-full grid-cols-2" tabindex="-1" data-orientation="horizontal" style="outline:none"><button type="button" role="tab" aria-selected="true" aria-controls="radix-_R_jer3_-content-devtools" data-state="active" data-disabled="" disabled="" id="radix-_R_jer3_-trigger-devtools" class="inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow" tabindex="-1" data-orientation="horizontal" data-radix-collection-item="">From App </button><button type="button" role="tab" aria-selected="false" aria-controls="radix-_R_jer3_-content-upload" data-state="inactive" id="radix-_R_jer3_-trigger-upload" class="inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow" tabindex="-1" data-orientation="horizontal" data-radix-collection-item="">Upload File</button></div><div data-state="inactive" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-_R_jer3_-trigger-upload" hidden="" id="radix-_R_jer3_-content-upload" tabindex="0" class="mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"></div><div data-state="active" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-_R_jer3_-trigger-devtools" id="radix-_R_jer3_-content-devtools" tabindex="0" class="mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2" style="animation-duration:0s"><div class="space-y-4"><div class="flex items-center justify-between"><h3 class="text-sm font-medium">Available Databases</h3><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-8 rounded-md px-3 text-xs"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw h-4 w-4 mr-2" aria-hidden="true"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"></path><path d="M8 16H3v5"></path></svg>Refresh</button></div><div class="text-center p-12 rounded-lg border-2 border-dashed border-muted-foreground/25"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database h-12 w-12 text-muted-foreground mx-auto mb-4" aria-hidden="true"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><p class="text-sm text-muted-foreground">No databases found. Make sure your app is using useSQLiteDevTool.</p></div></div></div></div></div></div></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><!--/$--><!--/$--></div></div><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/_layout-1da259c4109daa50bd04899675f5d333.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/index-17ca77580cae7c249688c43b3b3e0949.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__common-8b6d10c7ab64ecfd128d45105ef5590b.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/entry-5e24130038c41e25d9a78d08664ef6cb.js" defer></script>
318
318
  </body></html>
@@ -4,7 +4,6 @@
4
4
  "modules": ["SQLiteModule"]
5
5
  },
6
6
  "android": {
7
- "modules": ["expo.modules.sqlite.SQLiteModule"],
8
7
  "shouldUsePublicationScriptPath": "android/shouldUsePublication.groovy",
9
8
  "publication": {
10
9
  "groupId": "host.exp.exponent",
@@ -144,8 +144,11 @@ final class NativeDatabase: SharedObject, @unchecked Sendable {
144
144
  try statement.ensureNotFinalized()
145
145
  try ensureOpen()
146
146
  let sourceString = source.cString(using: .utf8)
147
- if exsqlite3_prepare_v2(pointer, sourceString, -1, &statement.pointer, nil) != SQLITE_OK {
148
- throw SQLiteErrorException(lastErrorMessage())
147
+ let result = sqliteResult(for: pointer) {
148
+ exsqlite3_prepare_v2(pointer, sourceString, -1, &statement.pointer, nil)
149
+ }
150
+ if let message = result.message {
151
+ throw SQLiteErrorException(message)
149
152
  }
150
153
  statements.append(statement)
151
154
  }
@@ -172,12 +175,6 @@ final class NativeDatabase: SharedObject, @unchecked Sendable {
172
175
  }
173
176
  }
174
177
 
175
- internal func sqliteErrorMessage(for db: OpaquePointer?) -> String {
176
- let code = exsqlite3_errcode(db)
177
- let message = String(cString: exsqlite3_errmsg(db), encoding: .utf8) ?? ""
178
- return "Error code \(code): \(message)"
179
- }
180
-
181
178
  // `==` lives in an extension: an operator declared inside a type that carries a member-attribute macro
182
179
  // is seen twice by the compiler and fails the `Equatable` conformance check.
183
180
  // swiftlint:disable:next no_grouping_extension
@@ -104,8 +104,9 @@ final class NativeStatement: SharedObject, @unchecked Sendable {
104
104
  try ensureNotFinalized()
105
105
  try database.ensureOpen()
106
106
 
107
- if exsqlite3_reset(pointer) != SQLITE_OK {
108
- throw SQLiteErrorException(database.lastErrorMessage())
107
+ let result = sqliteResult(for: database.pointer) { exsqlite3_reset(pointer) }
108
+ if let message = result.message {
109
+ throw SQLiteErrorException(message)
109
110
  }
110
111
  }
111
112
  }
@@ -129,13 +130,13 @@ final class NativeStatement: SharedObject, @unchecked Sendable {
129
130
  try ensureNotFinalized()
130
131
  try database.ensureOpen()
131
132
 
132
- let ret = exsqlite3_finalize(pointer)
133
+ let result = sqliteResult(for: database.pointer) { exsqlite3_finalize(pointer) }
133
134
  // SQLite destroys the statement even when returning an earlier execution error.
134
135
  isFinalized = true
135
136
  pointer = nil
136
137
  database.statements.removeAll { $0 === self }
137
- if ret != SQLITE_OK {
138
- throw SQLiteErrorException(database.lastErrorMessage())
138
+ if let message = result.message {
139
+ throw SQLiteErrorException(message)
139
140
  }
140
141
  }
141
142
  }
@@ -170,9 +171,10 @@ final class NativeStatement: SharedObject, @unchecked Sendable {
170
171
  }
171
172
  }
172
173
 
173
- let ret = exsqlite3_step(pointer)
174
- if ret != SQLITE_ROW && ret != SQLITE_DONE {
175
- throw SQLiteErrorException(database.lastErrorMessage())
174
+ let result = sqliteResult(for: database.pointer) { exsqlite3_step(pointer) }
175
+ let ret = result.code
176
+ if let message = result.message {
177
+ throw SQLiteErrorException(message)
176
178
  }
177
179
  return SQLiteRunResult(
178
180
  lastInsertRowId: Double(exsqlite3_last_insert_rowid(database.pointer)),
@@ -187,12 +189,13 @@ final class NativeStatement: SharedObject, @unchecked Sendable {
187
189
  try ensureNotFinalized()
188
190
  try database.ensureOpen()
189
191
 
190
- let ret = exsqlite3_step(pointer)
192
+ let result = sqliteResult(for: database.pointer) { exsqlite3_step(pointer) }
193
+ let ret = result.code
191
194
  if ret == SQLITE_ROW {
192
195
  return try columnValues()
193
196
  }
194
- if ret != SQLITE_DONE {
195
- throw SQLiteErrorException(database.lastErrorMessage())
197
+ if let message = result.message {
198
+ throw SQLiteErrorException(message)
196
199
  }
197
200
  return nil
198
201
  }
@@ -205,7 +208,8 @@ final class NativeStatement: SharedObject, @unchecked Sendable {
205
208
 
206
209
  var rows: [[SQLiteColumnValue?]] = []
207
210
  while true {
208
- let ret = exsqlite3_step(pointer)
211
+ let result = sqliteResult(for: database.pointer) { exsqlite3_step(pointer) }
212
+ let ret = result.code
209
213
  if ret == SQLITE_ROW {
210
214
  rows.append(try columnValues())
211
215
  continue
@@ -213,7 +217,10 @@ final class NativeStatement: SharedObject, @unchecked Sendable {
213
217
  if ret == SQLITE_DONE {
214
218
  break
215
219
  }
216
- throw SQLiteErrorException(database.lastErrorMessage())
220
+ if let message = result.message {
221
+ throw SQLiteErrorException(message)
222
+ }
223
+ throw SQLiteErrorException("Error code \(result.code)")
217
224
  }
218
225
  return rows
219
226
  }
@@ -0,0 +1,31 @@
1
+ // Copyright 2026-present 650 Industries. All rights reserved.
2
+
3
+ // Capture a statement's error while SQLite's recursive connection mutex still protects it.
4
+ // A different statement can otherwise replace both errcode and errmsg before we report the failure.
5
+ internal func sqliteErrorMessage(for db: OpaquePointer?, code: Int32) -> String {
6
+ let message = String(cString: exsqlite3_errmsg(db), encoding: .utf8) ?? ""
7
+ return "Error code \(code): \(message)"
8
+ }
9
+
10
+ internal func withSQLiteDatabaseLock<T>(for db: OpaquePointer?, _ operation: () throws -> T) rethrows -> T {
11
+ let mutex = exsqlite3_db_mutex(db)
12
+ exsqlite3_mutex_enter(mutex)
13
+ defer { exsqlite3_mutex_leave(mutex) }
14
+ return try operation()
15
+ }
16
+
17
+ internal func sqliteErrorMessage(for db: OpaquePointer?) -> String {
18
+ return withSQLiteDatabaseLock(for: db) {
19
+ return sqliteErrorMessage(for: db, code: exsqlite3_errcode(db))
20
+ }
21
+ }
22
+
23
+ internal func sqliteResult(for db: OpaquePointer?, _ operation: () -> Int32) -> (code: Int32, message: String?) {
24
+ return withSQLiteDatabaseLock(for: db) {
25
+ let code = operation()
26
+ guard code != SQLITE_OK && code != SQLITE_ROW && code != SQLITE_DONE else {
27
+ return (code, nil)
28
+ }
29
+ return (code, sqliteErrorMessage(for: db, code: code))
30
+ }
31
+ }
@@ -0,0 +1,25 @@
1
+ // Copyright 2026-present 650 Industries. All rights reserved.
2
+
3
+ import Testing
4
+
5
+ @testable import ExpoSQLite
6
+
7
+ @Suite("SQLite error reporting")
8
+ struct SQLiteErrorReportingTests {
9
+ @Test
10
+ func `captures the operation code and detail before another statement changes the connection error`() throws {
11
+ var db: OpaquePointer?
12
+ #expect(exsqlite3_open(":memory:", &db) == SQLITE_OK)
13
+ defer { exsqlite3_close(db) }
14
+ #expect(exsqlite3_exec(db, "CREATE TABLE item(id INTEGER PRIMARY KEY); INSERT INTO item VALUES (1)", nil, nil, nil) == SQLITE_OK)
15
+ var statement: OpaquePointer?
16
+ #expect(exsqlite3_prepare_v2(db, "INSERT INTO item VALUES (1)", -1, &statement, nil) == SQLITE_OK)
17
+ let execution = sqliteResult(for: db) { exsqlite3_step(statement) }
18
+ let cleanup = sqliteResult(for: db) { exsqlite3_finalize(statement) }
19
+ #expect(exsqlite3_exec(db, "SELECT 1", nil, nil, nil) == SQLITE_OK)
20
+ #expect(execution.code == SQLITE_CONSTRAINT)
21
+ #expect(cleanup.code == SQLITE_CONSTRAINT)
22
+ #expect(execution.message == "Error code 19: UNIQUE constraint failed: item.id")
23
+ #expect(cleanup.message == execution.message)
24
+ }
25
+ }
@@ -0,0 +1 @@
1
+ e4feeb357b13c3da0d6690deff9aab2186a7874185369a06c55fa6da992fdc9c
@@ -0,0 +1 @@
1
+ 93ce18d06cc3125618ca50503fd5b7f6d7407b05e931ddf6381fa7e70d8b41c6719c65a433fafa28626a12335b6e9f9a5e4cd05036f715e7a5b01c94047fddf7
@@ -0,0 +1 @@
1
+ 0832753b21e57b16e425e77702b1f0fdcb2cf1a6614c5a5bc0721f92bf3fb60c
@@ -0,0 +1 @@
1
+ fe5e05c035e8a3b493952282f2a26f117cf856664daf52600e32e532e1767da7a0636626289a4a99fcd50afabbe4f558d8015e0a2df8f4ced1b5eaeea59e216a
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.sqlite",
6
- "version": "58.0.10",
6
+ "version": "58.0.11",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.sqlite-58.0.10.aar",
28
- "url": "expo.modules.sqlite-58.0.10.aar",
29
- "size": 3958905,
30
- "sha512": "8da2bcca001991403ad15af7ae5fe40b6f02cf613801c3c109fc64b0a25980c07019c47fca22cbfef180ce826225442d307fc3b4416cc29127fda0c3880c666c",
31
- "sha256": "c4c90adee96c2308551babad7ac1fca8e3782ab14771b68933f1151a03436333",
32
- "sha1": "daaf8670dcbff2b9ab9410878e0a87e85eabad6f",
33
- "md5": "fad06d1b56a5b3ce76fff8218367c30e"
27
+ "name": "expo.modules.sqlite-58.0.11.aar",
28
+ "url": "expo.modules.sqlite-58.0.11.aar",
29
+ "size": 3845699,
30
+ "sha512": "fe5e05c035e8a3b493952282f2a26f117cf856664daf52600e32e532e1767da7a0636626289a4a99fcd50afabbe4f558d8015e0a2df8f4ced1b5eaeea59e216a",
31
+ "sha256": "0832753b21e57b16e425e77702b1f0fdcb2cf1a6614c5a5bc0721f92bf3fb60c",
32
+ "sha1": "63ce3f0e1b020dae031364283a1159bcdd8be178",
33
+ "md5": "91c6e3c5043af7233d9dc78dccd8b0a9"
34
34
  }
35
35
  ]
36
36
  },
@@ -67,13 +67,13 @@
67
67
  ],
68
68
  "files": [
69
69
  {
70
- "name": "expo.modules.sqlite-58.0.10.aar",
71
- "url": "expo.modules.sqlite-58.0.10.aar",
72
- "size": 3958905,
73
- "sha512": "8da2bcca001991403ad15af7ae5fe40b6f02cf613801c3c109fc64b0a25980c07019c47fca22cbfef180ce826225442d307fc3b4416cc29127fda0c3880c666c",
74
- "sha256": "c4c90adee96c2308551babad7ac1fca8e3782ab14771b68933f1151a03436333",
75
- "sha1": "daaf8670dcbff2b9ab9410878e0a87e85eabad6f",
76
- "md5": "fad06d1b56a5b3ce76fff8218367c30e"
70
+ "name": "expo.modules.sqlite-58.0.11.aar",
71
+ "url": "expo.modules.sqlite-58.0.11.aar",
72
+ "size": 3845699,
73
+ "sha512": "fe5e05c035e8a3b493952282f2a26f117cf856664daf52600e32e532e1767da7a0636626289a4a99fcd50afabbe4f558d8015e0a2df8f4ced1b5eaeea59e216a",
74
+ "sha256": "0832753b21e57b16e425e77702b1f0fdcb2cf1a6614c5a5bc0721f92bf3fb60c",
75
+ "sha1": "63ce3f0e1b020dae031364283a1159bcdd8be178",
76
+ "md5": "91c6e3c5043af7233d9dc78dccd8b0a9"
77
77
  }
78
78
  ]
79
79
  },
@@ -87,13 +87,13 @@
87
87
  },
88
88
  "files": [
89
89
  {
90
- "name": "expo.modules.sqlite-58.0.10-sources.jar",
91
- "url": "expo.modules.sqlite-58.0.10-sources.jar",
92
- "size": 12434,
93
- "sha512": "47d6b003042ef32b80e19b64fd015ffcfa159bb8f08971459211cd6ab971304da58dee6236c2be5319f606f9062d023530dcaa5c2e530bb17e42ab1465d5b95f",
94
- "sha256": "67dbdc88a1d7fc60c31092ad150a98a30d93d8ca82bbf869609890965425524d",
95
- "sha1": "afa88d36ec945ad0442cc3582e05eb84b07cb9f1",
96
- "md5": "f9c01cec01c62d6a619fdc69f237e033"
90
+ "name": "expo.modules.sqlite-58.0.11-sources.jar",
91
+ "url": "expo.modules.sqlite-58.0.11-sources.jar",
92
+ "size": 14875,
93
+ "sha512": "93ce18d06cc3125618ca50503fd5b7f6d7407b05e931ddf6381fa7e70d8b41c6719c65a433fafa28626a12335b6e9f9a5e4cd05036f715e7a5b01c94047fddf7",
94
+ "sha256": "e4feeb357b13c3da0d6690deff9aab2186a7874185369a06c55fa6da992fdc9c",
95
+ "sha1": "257a7ae7ca2f46a064622513d9ce08b515877773",
96
+ "md5": "5f6d9bf8e746dacc0378eead6be4ea33"
97
97
  }
98
98
  ]
99
99
  }
@@ -0,0 +1 @@
1
+ 376b11b9a3ff1e4b56b41ccdcdb5879e2b85b5d80806f288f895cecb36f5a74c
@@ -0,0 +1 @@
1
+ 5180af07e56734ca90b61f172c2984a788ec4f60db8389a550994c5b3d72a2dc3de085a1c098cc21c93cb9c93fac644e95c288054b682bfb213c3e49352e7f93
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.sqlite</artifactId>
12
- <version>58.0.10</version>
12
+ <version>58.0.11</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.sqlite</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 3ed8156bef90899add45b91bb45d8375b5f4685653a9904414a34e9d8b258129
@@ -0,0 +1 @@
1
+ a0b811afaadb78812cebc329aa2e4fc34ee2accf893d43ea4babfd594f2fd02b620cbca73361289ffda1fe8186cce5af2b5ae0227d69d3c1cf9ef04cc9cbb698
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-sqlite",
3
- "version": "58.0.10",
3
+ "version": "58.0.11",
4
4
  "description": "Provides access to a database using SQLite (https://www.sqlite.org/). The database is persisted across restarts of your app.",
5
5
  "keywords": [
6
6
  "async-storage",
@@ -50,13 +50,13 @@
50
50
  "await-lock": "^2.2.2"
51
51
  },
52
52
  "devDependencies": {
53
+ "@expo/internal-scripts": "58.0.1",
53
54
  "@expo/spawn-async": "^1.8.0",
54
55
  "@testing-library/react-native": "^14.0.1",
55
56
  "@types/jest": "^30.0.0",
56
57
  "@types/node": "^22.14.0",
57
58
  "@types/react": "~19.3.0",
58
- "expo": "58.0.4",
59
- "expo-module-scripts": "56.0.7",
59
+ "expo": "58.0.7",
60
60
  "react-error-boundary": "^4.0.11",
61
61
  "tar": "^7.5.22"
62
62
  },
@@ -66,7 +66,7 @@
66
66
  "react-native": "*"
67
67
  },
68
68
  "jest": {
69
- "preset": "expo-module-scripts"
69
+ "preset": "@expo/internal-scripts"
70
70
  },
71
71
  "scripts": {
72
72
  "precompile-android": "et prebuild-android-package-for-publish",
@@ -13,7 +13,7 @@ export declare class NativeDatabase {
13
13
  public isInTransactionAsync(): Promise<boolean>;
14
14
  public closeAsync(): Promise<void>;
15
15
  public execAsync(source: string): Promise<void>;
16
- public serializeAsync(databaseName: string): Promise<Uint8Array>;
16
+ public serializeAsync(databaseName: string): Promise<Uint8Array | ArrayBuffer>;
17
17
  public prepareAsync(nativeStatement: NativeStatement, source: string): Promise<NativeStatement>;
18
18
  public createSessionAsync(nativeSession: NativeSession, dbName: string): Promise<NativeSession>;
19
19
  public loadExtensionAsync(libPath: string, entryPoint?: string): Promise<void>;
@@ -27,7 +27,7 @@ export declare class NativeDatabase {
27
27
  public closeSync(): void;
28
28
  public interruptSync(): void;
29
29
  public execSync(source: string): void;
30
- public serializeSync(databaseName: string): Uint8Array;
30
+ public serializeSync(databaseName: string): Uint8Array | ArrayBuffer;
31
31
  public prepareSync(nativeStatement: NativeStatement, source: string): NativeStatement;
32
32
  public createSessionSync(nativeSession: NativeSession, dbName: string): NativeSession;
33
33
  public loadExtensionSync(libPath: string, entryPoint?: string): void;
@@ -63,8 +63,8 @@ export class SQLiteDatabase {
63
63
  *
64
64
  * @param databaseName The name of the current attached databases. The default value is `main` which is the default database name.
65
65
  */
66
- public serializeAsync(databaseName: string = 'main'): Promise<Uint8Array> {
67
- return this.nativeDatabase.serializeAsync(databaseName);
66
+ public async serializeAsync(databaseName: string = 'main'): Promise<Uint8Array> {
67
+ return toUint8Array(await this.nativeDatabase.serializeAsync(databaseName));
68
68
  }
69
69
 
70
70
  /**
@@ -264,7 +264,7 @@ export class SQLiteDatabase {
264
264
  * @param databaseName The name of the current attached databases. The default value is `main` which is the default database name.
265
265
  */
266
266
  public serializeSync(databaseName: string = 'main'): Uint8Array {
267
- return this.nativeDatabase.serializeSync(databaseName);
267
+ return toUint8Array(this.nativeDatabase.serializeSync(databaseName));
268
268
  }
269
269
 
270
270
  /**
@@ -802,3 +802,11 @@ class Transaction extends SQLiteDatabase {
802
802
  return new Transaction(db.databasePath, options, nativeDatabase);
803
803
  }
804
804
  }
805
+
806
+ /**
807
+ * The native database hands serialized bytes over as a `Uint8Array` on iOS and as an `ArrayBuffer`
808
+ * on Android.
809
+ */
810
+ function toUint8Array(data: Uint8Array | ArrayBuffer): Uint8Array {
811
+ return data instanceof Uint8Array ? data : new Uint8Array(data);
812
+ }
@@ -1 +0,0 @@
1
- 67dbdc88a1d7fc60c31092ad150a98a30d93d8ca82bbf869609890965425524d
@@ -1 +0,0 @@
1
- 47d6b003042ef32b80e19b64fd015ffcfa159bb8f08971459211cd6ab971304da58dee6236c2be5319f606f9062d023530dcaa5c2e530bb17e42ab1465d5b95f
@@ -1 +0,0 @@
1
- c4c90adee96c2308551babad7ac1fca8e3782ab14771b68933f1151a03436333
@@ -1 +0,0 @@
1
- 8da2bcca001991403ad15af7ae5fe40b6f02cf613801c3c109fc64b0a25980c07019c47fca22cbfef180ce826225442d307fc3b4416cc29127fda0c3880c666c
@@ -1 +0,0 @@
1
- dfc2cb2d98cfef3bd6b5be8f805dd3444b34c4755dfc2f6ff0e0b653ba123cd3
@@ -1 +0,0 @@
1
- 73ae3ffc162990e89b804689ba3d929767b2619e57e56d78c277b4c772fd8cd284ff0cda1a1418342b5f21c68fd4538548ab273f38c390a31dbd5a6e8800143f
@@ -1 +0,0 @@
1
- d46287f54d70926645728cdb6a436ad843ea632fbdf9274a29c6227de2e61532
@@ -1 +0,0 @@
1
- 584fceef6dc748071a484a1cee817dbc73fc8ce8838fbcb29a1d429a2b8eb36d608d7acd3a17c10f8e35a78ded5064bc01bb839376dc11b59e5c82937a23f4bf