Skip to content

Commit

Permalink
wip crate refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
abonander committed Sep 21, 2022
1 parent 7f0d1af commit ae2b293
Show file tree
Hide file tree
Showing 320 changed files with 2,770 additions and 7,571 deletions.
1,860 changes: 153 additions & 1,707 deletions Cargo.lock

Large diffs are not rendered by default.

59 changes: 29 additions & 30 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ members = [
".",
"sqlx-core",
"sqlx-macros",
"sqlx-test",
"sqlx-cli",
"sqlx-bench",
"examples/mysql/todos",
"examples/postgres/axum-social-with-tests",
"examples/postgres/files",
"examples/postgres/json",
"examples/postgres/listen",
"examples/postgres/todos",
"examples/postgres/mockable-todos",
"examples/postgres/transaction",
"examples/sqlite/todos",
"sqlx-macros-core",
# "sqlx-test",
# "sqlx-cli",
# "sqlx-bench",
"sqlx-mysql",
"sqlx-postgres",
"sqlx-sqlite",
# "examples/mysql/todos",
# "examples/postgres/axum-social-with-tests",
# "examples/postgres/files",
# "examples/postgres/json",
# "examples/postgres/listen",
# "examples/postgres/todos",
# "examples/postgres/mockable-todos",
# "examples/postgres/transaction",
# "examples/sqlite/todos",
]

[package]
Expand Down Expand Up @@ -51,9 +55,8 @@ tls = []
offline = ["sqlx-macros/offline", "sqlx-core/offline"]

# intended mainly for CI and docs
all = ["tls", "all-databases", "all-types"]
all-databases = ["mysql", "sqlite", "postgres", "mssql", "any"]
all-types = [
#all-databases = ["mysql", "sqlite", "postgres", "mssql", "any"]
_unstable_all-types = [
"bigdecimal",
"decimal",
"json",
Expand All @@ -64,18 +67,15 @@ all-types = [
"uuid",
"bit-vec",
"bstr",
"git2",
]

# Base runtime features without TLS
runtime-actix = ["_rt-tokio", "sqlx-core/runtime-tokio", "sqlx-macros/runtime-tokio"]
runtime-async-std = ["_rt-async-std", "sqlx-core/runtime-async-std", "sqlx-macros/runtime-async-std"]
runtime-tokio = ["_rt-tokio", "sqlx-core/runtime-tokio", "sqlx-macros/runtime-tokio"]
runtime-async-std = ["_rt-async-std", "sqlx-core/_rt-async-std", "sqlx-macros/_rt-async-std"]
runtime-tokio = ["_rt-tokio", "sqlx-core/_rt-tokio", "sqlx-macros/_rt-tokio"]

# TLS features
# didn't call this `tls-native-tls` because of the annoying tautology
tls-native = ["sqlx-core/tls-native", "sqlx-macros/tls-native"]
tls-rustls = ["sqlx-core/tls-rustls", "sqlx-macros/tls-rustls"]
tls-native-tls = ["sqlx-core/_tls-native-tls", "sqlx-macros/_tls-native-tls"]
tls-rustls = ["sqlx-core/_tls-rustls", "sqlx-macros/_tls-rustls"]

# No-op feature used by the workflows to compile without TLS enabled. Not meant for general use.
tls-none = []
Expand All @@ -84,10 +84,10 @@ tls-none = []
runtime-actix-native-tls = ["runtime-tokio-native-tls"]
runtime-actix-rustls = ["runtime-tokio-rustls"]

runtime-async-std-native-tls = ["runtime-async-std", "tls-native"]
runtime-async-std-native-tls = ["runtime-async-std", "tls-native-tls"]
runtime-async-std-rustls = ["runtime-async-std", "tls-rustls"]

runtime-tokio-native-tls = ["runtime-tokio", "tls-native"]
runtime-tokio-native-tls = ["runtime-tokio", "tls-native-tls"]
runtime-tokio-rustls = ["runtime-tokio", "tls-rustls"]

# for conditional compilation
Expand All @@ -96,10 +96,10 @@ _rt-tokio = []

# database
any = ["sqlx-core/any"]
postgres = ["sqlx-core/postgres", "sqlx-macros/postgres"]
mysql = ["sqlx-core/mysql", "sqlx-macros/mysql"]
sqlite = ["sqlx-core/sqlite", "sqlx-macros/sqlite"]
mssql = ["sqlx-core/mssql", "sqlx-macros/mssql"]
#postgres = ["sqlx-core/postgres", "sqlx-macros/postgres"]
#mysql = ["sqlx-core/mysql", "sqlx-macros/mysql"]
#sqlite = ["sqlx-core/sqlite", "sqlx-macros/sqlite"]
#mssql = ["sqlx-core/mssql", "sqlx-macros/mssql"]

# types
bigdecimal = ["sqlx-core/bigdecimal", "sqlx-macros/bigdecimal"]
Expand All @@ -112,7 +112,6 @@ json = ["sqlx-core/json", "sqlx-macros/json"]
time = ["sqlx-core/time", "sqlx-macros/time"]
bit-vec = ["sqlx-core/bit-vec", "sqlx-macros/bit-vec"]
bstr = ["sqlx-core/bstr"]
git2 = ["sqlx-core/git2"]

[dependencies]
sqlx-core = { version = "0.6.2", path = "sqlx-core", default-features = false }
Expand All @@ -137,7 +136,7 @@ rand_xoshiro = "0.6.0"
hex = "0.4.3"
tempdir = "0.3.7"
# Needed to test SQLCipher
libsqlite3-sys = { version = "0.24", features = ["bundled-sqlcipher"] }
libsqlite3-sys = { version = "0.25", features = ["bundled-sqlcipher"] }

#
# Any
Expand Down
8 changes: 4 additions & 4 deletions sqlx-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ filetime = "0.2"
backoff = { version = "0.4.0", features = ["futures", "tokio"] }

[features]
default = ["postgres", "sqlite", "mysql", "native-tls"]
#default = ["postgres", "sqlite", "mysql", "native-tls"]
rustls = ["sqlx/runtime-tokio-rustls"]
native-tls = ["sqlx/runtime-tokio-native-tls"]

# databases
mysql = ["sqlx/mysql"]
postgres = ["sqlx/postgres"]
sqlite = ["sqlx/sqlite"]
#mysql = ["sqlx/mysql"]
#postgres = ["sqlx/postgres"]
#sqlite = ["sqlx/sqlite"]

# workaround for musl + openssl issues
openssl-vendored = ["openssl/vendored"]
106 changes: 27 additions & 79 deletions sqlx-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,33 @@ authors = [
features = ["all-databases", "all-types", "offline", "runtime-tokio-native-tls"]

[features]
default = ["migrate"]
default = []
migrate = ["sha2", "crc"]

# databases
all-databases = ["postgres", "mysql", "sqlite", "mssql", "any"]
postgres = [
"md-5",
"sha2",
"base64",
"sha1",
"rand",
"hmac",
"futures-channel/sink",
"futures-util/sink",
"json",
"dirs",
"whoami",
"hkdf"
]
mysql = [
"sha1",
"sha2",
"generic-array",
"num-bigint",
"digest",
"rand",
"rsa",
]
sqlite = ["libsqlite3-sys", "futures-executor", "flume"]
mssql = ["uuid", "encoding_rs", "regex"]
#postgres = [
# "md-5",
# "sha2",
# "base64",
# "sha1",
# "rand",
# "hmac",
# "futures-channel/sink",
# "futures-util/sink",
# "json",
# "dirs",
# "whoami",
# "hkdf"
#]
#mysql = [
# "sha1",
# "sha2",
# "generic-array",
# "num-bigint",
# "digest",
# "rand",
# "rsa",
#]
any = []

# types
Expand All @@ -64,35 +61,6 @@ bigdecimal = ["bigdecimal_", "num-bigint"]
decimal = ["rust_decimal", "num-bigint"]
json = ["serde", "serde_json"]

# runtimes
runtime-actix-native-tls = ["runtime-tokio-native-tls"]
runtime-async-std-native-tls = [
"sqlx-rt/runtime-async-std-native-tls",
"sqlx/runtime-async-std-native-tls",
"_tls-native-tls",
"_rt-async-std",
]
runtime-tokio-native-tls = [
"sqlx-rt/runtime-tokio-native-tls",
"sqlx/runtime-tokio-native-tls",
"_tls-native-tls",
"_rt-tokio",
]

runtime-actix-rustls = ['runtime-tokio-rustls']
runtime-async-std-rustls = [
"sqlx-rt/runtime-async-std-rustls",
"sqlx/runtime-async-std-rustls",
"_tls-rustls",
"_rt-async-std",
]
runtime-tokio-rustls = [
"sqlx-rt/runtime-tokio-rustls",
"sqlx/runtime-tokio-rustls",
"_tls-rustls",
"_rt-tokio"
]

# for conditional compilation
_rt-async-std = []
_rt-tokio = ["tokio-stream"]
Expand All @@ -106,8 +74,6 @@ offline = ["serde", "either/serde"]
paste = "1.0.6"
ahash = "0.7.6"
atoi = "1.0"
sqlx-rt = { path = "../sqlx-rt", version = "0.6.2" }
base64 = { version = "0.13.0", default-features = false, optional = true, features = ["std"] }
bigdecimal_ = { version = "0.3.0", optional = true, package = "bigdecimal" }
rust_decimal = { version = "1.19.0", optional = true }
bit-vec = { version = "0.6.3", optional = true }
Expand All @@ -118,36 +84,22 @@ chrono = { version = "0.4.19", default-features = false, features = ["clock"], o
crc = { version = "3", optional = true }
crossbeam-queue = "0.3.2"
digest = { version = "0.10.0", default-features = false, optional = true, features = ["std"] }
dirs = { version = "4.0.0", optional = true }
encoding_rs = { version = "0.8.30", optional = true }
either = "1.6.1"
futures-channel = { version = "0.3.19", default-features = false, features = ["sink", "alloc", "std"] }
futures-core = { version = "0.3.19", default-features = false }
futures-io = "0.3.24"
futures-intrusive = "0.4.0"
futures-util = { version = "0.3.19", default-features = false, features = ["alloc", "sink"] }
# used by the SQLite worker thread to block on the async mutex that locks the database handle
futures-executor = { version = "0.3.19", optional = true }
flume = { version = "0.10.9", optional = true, default-features = false, features = ["async"] }
futures-util = { version = "0.3.19", default-features = false, features = ["alloc", "sink", "io"] }
generic-array = { version = "0.14.4", default-features = false, optional = true }
hex = "0.4.3"
hmac = { version = "0.12.0", default-features = false, optional = true }
itoa = "1.0.1"
ipnetwork = { version = "0.19.0", default-features = false, optional = true }
mac_address = { version = "1.1.2", default-features = false, optional = true }
libc = "0.2.112"
libsqlite3-sys = { version = "0.25.1", optional = true, default-features = false, features = [
"pkg-config",
"vcpkg",
"bundled",
"unlock_notify"
] }
log = { version = "0.4.14", default-features = false }
md-5 = { version = "0.10.0", default-features = false, optional = true }
memchr = { version = "2.4.1", default-features = false }
num-bigint = { version = "0.4.0", default-features = false, optional = true, features = ["std"] }
once_cell = "1.9.0"
percent-encoding = "2.1.0"
rand = { version = "0.8.4", default-features = false, optional = true, features = ["std", "std_rng"] }
regex = { version = "1.5.5", optional = true }
rsa = { version = "0.6.0", optional = true }
rustls = { version = "0.20.1", features = ["dangerous_configuration"], optional = true }
Expand All @@ -164,19 +116,15 @@ smallvec = "1.7.0"
url = { version = "2.2.2", default-features = false }
uuid = { version = "1.0", default-features = false, optional = true, features = ["std"] }
webpki-roots = { version = "0.22.0", optional = true }
whoami = { version = "1.2.1", optional = true }
stringprep = "0.1.2"
bstr = { version = "0.2.17", default-features = false, features = ["std"], optional = true }
git2 = { version = "0.14", default-features = false, optional = true }
hashlink = "0.8.0"
# NOTE: *must* remain below 1.7.0 to allow users to avoid the `ahash` cyclic dependency problem by pinning the version
# https://github.com/tkaitchuck/aHash/issues/95#issuecomment-874150078
indexmap = "1.6.0"
hkdf = { version = "0.12.0", optional = true }
event-listener = "2.5.2"

dotenvy = "0.15"

[dev-dependencies]
sqlx = { version = "0.6.2", path = "..", features = ["postgres", "sqlite", "mysql"] }
#sqlx = { version = "0.6.2", path = "..", features = ["postgres", "sqlite", "mysql"] }
tokio = { version = "1", features = ["rt"] }
Loading

0 comments on commit ae2b293

Please sign in to comment.