From 1f985f2247d9d86140c7b7052eec38b51039c7cd Mon Sep 17 00:00:00 2001
From: Carl Sverre <82591+carlsverre@users.noreply.github.com>
Date: Mon, 8 Jan 2024 13:55:37 -0800
Subject: [PATCH] upgrade to sqlite 3.44.0

I have created a fork of rusqlite based on trevyn/rusqlite which pulls in compiler-rt: https://github.com/trevyn/rusqlite/pull/1

This seems to allow sqlite to compile and run. Great success!

Resolves #26
---
 Cargo.lock | 69 +++++++++++++++++++++++++++++++++++-------------------
 Cargo.toml |  8 +++----
 2 files changed, 49 insertions(+), 28 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 925725b..aeb59ca 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -19,13 +19,14 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
 
 [[package]]
 name = "ahash"
-version = "0.7.7"
+version = "0.8.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd"
+checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
 dependencies = [
- "getrandom",
+ "cfg-if",
  "once_cell",
  "version_check",
+ "zerocopy",
 ]
 
 [[package]]
@@ -37,6 +38,12 @@ dependencies = [
  "memchr",
 ]
 
+[[package]]
+name = "allocator-api2"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
+
 [[package]]
 name = "anyhow"
 version = "1.0.79"
@@ -101,9 +108,9 @@ dependencies = [
 
 [[package]]
 name = "bitflags"
-version = "1.3.2"
+version = "2.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
 
 [[package]]
 name = "block-buffer"
@@ -292,9 +299,9 @@ dependencies = [
 
 [[package]]
 name = "fallible-iterator"
-version = "0.2.0"
+version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
+checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
 
 [[package]]
 name = "fallible-streaming-iterator"
@@ -607,26 +614,21 @@ dependencies = [
 
 [[package]]
 name = "hashbrown"
-version = "0.11.2"
+version = "0.14.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
+checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
 dependencies = [
  "ahash",
+ "allocator-api2",
 ]
 
-[[package]]
-name = "hashbrown"
-version = "0.14.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
-
 [[package]]
 name = "hashlink"
-version = "0.7.0"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf"
+checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7"
 dependencies = [
- "hashbrown 0.11.2",
+ "hashbrown",
 ]
 
 [[package]]
@@ -663,7 +665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
 dependencies = [
  "equivalent",
- "hashbrown 0.14.3",
+ "hashbrown",
 ]
 
 [[package]]
@@ -707,8 +709,8 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
 
 [[package]]
 name = "libsqlite3-sys"
-version = "0.23.2"
-source = "git+https://github.com/trevyn/rusqlite?rev=82354cffd26a8e1c58613e21defe27110c141a1d#82354cffd26a8e1c58613e21defe27110c141a1d"
+version = "0.27.0"
+source = "git+https://github.com/carlsverre/rusqlite?rev=7c6cd3bf6118ee3e9f7ac3babbc74086860415d2#7c6cd3bf6118ee3e9f7ac3babbc74086860415d2"
 dependencies = [
  "cc",
  "getrandom",
@@ -1002,15 +1004,14 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
 
 [[package]]
 name = "rusqlite"
-version = "0.26.3"
-source = "git+https://github.com/trevyn/rusqlite?rev=82354cffd26a8e1c58613e21defe27110c141a1d#82354cffd26a8e1c58613e21defe27110c141a1d"
+version = "0.30.0"
+source = "git+https://github.com/carlsverre/rusqlite?rev=7c6cd3bf6118ee3e9f7ac3babbc74086860415d2#7c6cd3bf6118ee3e9f7ac3babbc74086860415d2"
 dependencies = [
  "bitflags",
  "fallible-iterator",
  "fallible-streaming-iterator",
  "hashlink",
  "libsqlite3-sys",
- "memchr",
  "smallvec",
 ]
 
@@ -1740,3 +1741,23 @@ dependencies = [
  "wasm-bindgen",
  "web-sys",
 ]
+
+[[package]]
+name = "zerocopy"
+version = "0.7.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
+dependencies = [
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.7.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
diff --git a/Cargo.toml b/Cargo.toml
index 3572b3b..41479c0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -63,13 +63,13 @@ gloo-net = { git = "https://github.com/carlsverre/gloo", rev = "90f88e31daf1a959
 tsify = { git = "https://github.com/carlsverre/tsify", rev = "c05a60b6ae15b2869bf63f618940dc56ef516d1d", default-features = false }
 
 [workspace.dependencies.libsqlite3-sys]
-git = "https://github.com/trevyn/rusqlite"
+git = "https://github.com/carlsverre/rusqlite"
 features = ["bundled"]
 # on branch: https://github.com/trevyn/rusqlite?branch=wasm32-unknown-unknown
-rev = "82354cffd26a8e1c58613e21defe27110c141a1d"
+rev = "7c6cd3bf6118ee3e9f7ac3babbc74086860415d2"
 
 [workspace.dependencies.rusqlite]
-git = "https://github.com/trevyn/rusqlite"
+git = "https://github.com/carlsverre/rusqlite"
 features = ["bundled", "hooks", "modern_sqlite"]
 # on branch: https://github.com/trevyn/rusqlite?branch=wasm32-unknown-unknown
-rev = "82354cffd26a8e1c58613e21defe27110c141a1d"
+rev = "7c6cd3bf6118ee3e9f7ac3babbc74086860415d2"