Browse Source

mv lib-sqlite to rust-lib

appflowy 3 years ago
parent
commit
ef491f4276

+ 1 - 2
frontend/rust-lib/Cargo.toml

@@ -2,6 +2,7 @@
 members = [
   "lib-dispatch",
   "lib-log",
+  "lib-sqlite",
   "flowy-net",
   "flowy-sdk",
   "dart-ffi",
@@ -14,7 +15,5 @@ members = [
   "flowy-error",
 ]
 
-exclude = ["../backend"]
-
 [profile.dev]
 split-debuginfo = "unpacked"

+ 1 - 2
frontend/rust-lib/flowy-core/Cargo.toml

@@ -10,7 +10,6 @@ flowy-core-data-model = { path = "../../../shared-lib/flowy-core-data-model" }
 flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
 flowy-derive = { path = "../../../shared-lib/flowy-derive" }
 lib-ot = { path = "../../../shared-lib/lib-ot" }
-lib-sqlite = { path = "../../../shared-lib/lib-sqlite" }
 backend-service = { path = "../../../shared-lib/backend-service" }
 lib-infra = { path = "../../../shared-lib/lib-infra" }
 
@@ -20,7 +19,7 @@ flowy-error = { path = "../flowy-error", features = ["db", "backend"]}
 flowy-net = { path = "../flowy-net" }
 dart-notify = { path = "../dart-notify" }
 lib-dispatch = { path = "../lib-dispatch" }
-
+lib-sqlite = { path = "../lib-sqlite" }
 
 parking_lot = "0.11"
 protobuf = {version = "2.18.0"}

+ 1 - 1
frontend/rust-lib/flowy-database/Cargo.toml

@@ -9,6 +9,6 @@ edition = "2018"
 diesel = {version = "1.4.8", features = ["sqlite"]}
 diesel_derives = {version = "1.4.1", features = ["sqlite"]}
 diesel_migrations = {version = "1.4.0", features = ["sqlite"]}
-lib-sqlite = { path = "../../../shared-lib/lib-sqlite" }
+lib-sqlite = { path = "../lib-sqlite" }
 log = "0.4"
 lazy_static = "1.4.0"

+ 1 - 1
frontend/rust-lib/flowy-error/Cargo.toml

@@ -18,8 +18,8 @@ lib-ot = { path = "../../../shared-lib/lib-ot", optional = true}
 serde_json = {version = "1.0", optional = true}
 backend-service = { path = "../../../shared-lib/backend-service", optional = true}
 flowy-database = { path = "../flowy-database", optional = true}
-lib-sqlite = { path = "../../../shared-lib/lib-sqlite", optional = true}
 r2d2 = { version = "0.8", optional = true}
+lib-sqlite = { path = "../lib-sqlite", optional = true }
 
 [features]
 collaboration = ["flowy-collaboration"]

+ 1 - 2
frontend/rust-lib/flowy-user/Cargo.toml

@@ -9,9 +9,7 @@ edition = "2018"
 flowy-user-data-model = { path = "../../../shared-lib/flowy-user-data-model" }
 backend-service = { path = "../../../shared-lib/backend-service" }
 flowy-derive = { path = "../../../shared-lib/flowy-derive" }
-lib-sqlite = { path = "../../../shared-lib/lib-sqlite" }
 lib-infra = { path = "../../../shared-lib/lib-infra" }
-
 flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration", optional = true}
 
 derive_more = {version = "0.99", features = ["display"]}
@@ -20,6 +18,7 @@ flowy-net = { path = "../flowy-net" }
 dart-notify = { path = "../dart-notify" }
 lib-dispatch = { path = "../lib-dispatch" }
 flowy-error = { path = "../flowy-error", features = ["db", "backend"] }
+lib-sqlite = { path = "../lib-sqlite" }
 
 
 tracing = { version = "0.1", features = ["log"] }

+ 0 - 0
shared-lib/lib-sqlite/Cargo.toml → frontend/rust-lib/lib-sqlite/Cargo.toml


+ 0 - 0
shared-lib/lib-sqlite/src/conn_ext.rs → frontend/rust-lib/lib-sqlite/src/conn_ext.rs


+ 0 - 0
shared-lib/lib-sqlite/src/database.rs → frontend/rust-lib/lib-sqlite/src/database.rs


+ 0 - 0
shared-lib/lib-sqlite/src/errors.rs → frontend/rust-lib/lib-sqlite/src/errors.rs


+ 0 - 0
shared-lib/lib-sqlite/src/lib.rs → frontend/rust-lib/lib-sqlite/src/lib.rs


+ 0 - 0
shared-lib/lib-sqlite/src/pool.rs → frontend/rust-lib/lib-sqlite/src/pool.rs


+ 0 - 0
shared-lib/lib-sqlite/src/pragma.rs → frontend/rust-lib/lib-sqlite/src/pragma.rs


+ 0 - 153
shared-lib/Cargo.lock

@@ -185,15 +185,6 @@ dependencies = [
  "syn",
 ]
 
-[[package]]
-name = "addr2line"
-version = "0.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
-dependencies = [
- "gimli",
-]
-
 [[package]]
 name = "adler"
 version = "1.0.2"
@@ -297,21 +288,6 @@ dependencies = [
  "uuid",
 ]
 
-[[package]]
-name = "backtrace"
-version = "0.3.63"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
 [[package]]
 name = "base-x"
 version = "0.2.8"
@@ -539,38 +515,6 @@ dependencies = [
  "syn",
 ]
 
-[[package]]
-name = "diesel"
-version = "1.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b28135ecf6b7d446b43e27e225622a038cc4e2930a1022f51cdb97ada19b8e4d"
-dependencies = [
- "byteorder",
- "diesel_derives",
- "libsqlite3-sys",
-]
-
-[[package]]
-name = "diesel_derives"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "diesel_migrations"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf3cde8413353dc7f5d72fa8ce0b99a560a359d2c5ef1e5817ca731cd9008f4c"
-dependencies = [
- "migrations_internals",
- "migrations_macros",
-]
-
 [[package]]
 name = "digest"
 version = "0.9.0"
@@ -624,15 +568,6 @@ dependencies = [
  "termcolor",
 ]
 
-[[package]]
-name = "error-chain"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
-dependencies = [
- "backtrace",
-]
-
 [[package]]
 name = "error-code"
 version = "0.1.0"
@@ -922,12 +857,6 @@ dependencies = [
  "wasi 0.10.0+wasi-snapshot-preview1",
 ]
 
-[[package]]
-name = "gimli"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
-
 [[package]]
 name = "glob"
 version = "0.3.0"
@@ -1174,21 +1103,6 @@ dependencies = [
  "tracing",
 ]
 
-[[package]]
-name = "lib-sqlite"
-version = "0.1.0"
-dependencies = [
- "diesel",
- "diesel_derives",
- "diesel_migrations",
- "error-chain",
- "lazy_static",
- "libsqlite3-sys",
- "log",
- "r2d2",
- "scheduled-thread-pool",
-]
-
 [[package]]
 name = "lib-ws"
 version = "0.1.0"
@@ -1222,17 +1136,6 @@ version = "0.2.107"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219"
 
-[[package]]
-name = "libsqlite3-sys"
-version = "0.22.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d"
-dependencies = [
- "cc",
- "pkg-config",
- "vcpkg",
-]
-
 [[package]]
 name = "linked-hash-map"
 version = "0.5.4"
@@ -1293,27 +1196,6 @@ version = "2.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
 
-[[package]]
-name = "migrations_internals"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b4fc84e4af020b837029e017966f86a1c2d5e83e64b589963d5047525995860"
-dependencies = [
- "diesel",
-]
-
-[[package]]
-name = "migrations_macros"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9753f12909fd8d923f75ae5c3258cae1ed3c8ec052e1b38c93c21a6d157f789c"
-dependencies = [
- "migrations_internals",
- "proc-macro2",
- "quote",
- "syn",
-]
-
 [[package]]
 name = "mime"
 version = "0.3.16"
@@ -1419,15 +1301,6 @@ dependencies = [
  "libc",
 ]
 
-[[package]]
-name = "object"
-version = "0.27.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9"
-dependencies = [
- "memchr",
-]
-
 [[package]]
 name = "once_cell"
 version = "1.8.0"
@@ -1622,17 +1495,6 @@ dependencies = [
  "proc-macro2",
 ]
 
-[[package]]
-name = "r2d2"
-version = "0.8.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f"
-dependencies = [
- "log",
- "parking_lot",
- "scheduled-thread-pool",
-]
-
 [[package]]
 name = "rand"
 version = "0.7.3"
@@ -1784,12 +1646,6 @@ dependencies = [
  "winreg",
 ]
 
-[[package]]
-name = "rustc-demangle"
-version = "0.1.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
-
 [[package]]
 name = "rustc_version"
 version = "0.2.3"
@@ -1824,15 +1680,6 @@ dependencies = [
  "winapi",
 ]
 
-[[package]]
-name = "scheduled-thread-pool"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc6f74fd1204073fa02d5d5d68bec8021be4c38690b61264b2fdb48083d0e7d7"
-dependencies = [
- "parking_lot",
-]
-
 [[package]]
 name = "scopeguard"
 version = "1.1.0"

+ 0 - 1
shared-lib/Cargo.toml

@@ -5,7 +5,6 @@ members = [
   "flowy-collaboration",
   "lib-ot",
   "lib-ws",
-  "lib-sqlite",
   "lib-infra",
   "backend-service",
   "flowy-derive",