Merge branch 'dependencies' into 'main'

Cleanup dependencies

See merge request x433485/minisql!39
This commit is contained in:
Yuriy Dupyn 2024-02-05 23:53:10 +01:00
commit fa34eac409
12 changed files with 55 additions and 142 deletions

96
Cargo.lock generated
View file

@ -82,12 +82,6 @@ dependencies = [
"syn 2.0.48", "syn 2.0.48",
] ]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]] [[package]]
name = "backtrace" name = "backtrace"
version = "0.3.69" version = "0.3.69"
@ -131,12 +125,6 @@ dependencies = [
"virtue", "virtue",
] ]
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]] [[package]]
name = "bytes" name = "bytes"
version = "1.5.0" version = "1.5.0"
@ -204,8 +192,6 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
"minisql",
"parser",
"proto", "proto",
"tokio", "tokio",
] ]
@ -241,9 +227,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.3.3" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3"
[[package]] [[package]]
name = "itoa" name = "itoa"
@ -257,16 +243,6 @@ version = "0.2.151"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
[[package]]
name = "lock_api"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
dependencies = [
"autocfg",
"scopeguard",
]
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.6.4" version = "2.6.4"
@ -366,29 +342,6 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "parking_lot"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-targets 0.48.5",
]
[[package]] [[package]]
name = "parser" name = "parser"
version = "0.1.0" version = "0.1.0"
@ -509,15 +462,6 @@ dependencies = [
"rand_core", "rand_core",
] ]
[[package]]
name = "redox_syscall"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
dependencies = [
"bitflags",
]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.23" version = "0.1.23"
@ -530,12 +474,6 @@ version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
[[package]]
name = "scopeguard"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.196" version = "1.0.196"
@ -578,25 +516,9 @@ dependencies = [
"parser", "parser",
"proto", "proto",
"rand", "rand",
"serde_json",
"tokio", "tokio",
] ]
[[package]]
name = "signal-hook-registry"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
dependencies = [
"libc",
]
[[package]]
name = "smallvec"
version = "1.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
[[package]] [[package]]
name = "socket2" name = "socket2"
version = "0.5.5" version = "0.5.5"
@ -647,18 +569,18 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.50" version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.50" version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
dependencies = [ dependencies = [
"proc-macro2 1.0.78", "proc-macro2 1.0.78",
"quote 1.0.35", "quote 1.0.35",
@ -667,18 +589,16 @@ dependencies = [
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.35.1" version = "1.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
"libc", "libc",
"mio", "mio",
"num_cpus", "num_cpus",
"parking_lot",
"pin-project-lite", "pin-project-lite",
"signal-hook-registry",
"socket2", "socket2",
"tokio-macros", "tokio-macros",
"windows-sys 0.48.0", "windows-sys 0.48.0",

View file

@ -8,3 +8,14 @@ members = [
"parser", "parser",
"storage_engine" "storage_engine"
] ]
[workspace.dependencies]
anyhow = "1.0.79"
async-trait = "0.1.77"
bimap = "0.6.3"
bincode = "2.0.0-rc.3"
clap = "4.4.18"
rand = "0.8.5"
serde = "1.0.196"
thiserror = "1.0.56"
tokio = "1.36.0"

View file

@ -6,9 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
tokio = { version = "1.35.1", features = ["full"] } anyhow = { workspace = true }
anyhow = "1.0.76" clap = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = ["io-util", "macros", "net", "rt-multi-thread"] }
proto = { path = "../proto" } proto = { path = "../proto" }
minisql = { path = "../minisql" }
parser = { path = "../parser" }
clap = { version = "4.4.18", features = ["derive"] }

View file

@ -7,13 +7,14 @@ rust-version = "1.74"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
anyhow = "1.0.79" anyhow = { workspace = true }
async-trait = "0.1.77" async-trait = { workspace = true }
bimap = { version = "0.6.3", features = ["serde"] } bimap = { workspace = true, features = ["serde"] }
bincode = "2.0.0-rc.3" bincode = { workspace = true }
serde = { version = "1.0.196", features = ["derive", "rc"] } serde = { workspace = true, features = ["derive", "rc"] }
tokio = { version = "1.34.0", features = ["full"] } serde_json = "1.0.113"
thiserror = "1.0.50" thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros", "sync"] }
proto = { path = "../proto" } proto = { path = "../proto" }
storage_engine = { path = "../storage_engine" } storage_engine = { path = "../storage_engine" }
serde_json = "1.0.113"

View file

@ -128,7 +128,6 @@ impl State {
} }
async fn attach_table(&mut self, table: Table) { async fn attach_table(&mut self, table: Table) {
// TODO: You need to update the global DB SCHEMA!
let new_table_position: TablePosition = self.tables.len(); let new_table_position: TablePosition = self.tables.len();
self.table_name_position_mapping self.table_name_position_mapping
.insert(table.schema().table_name().clone(), new_table_position); .insert(table.schema().table_name().clone(), new_table_position);

View file

@ -2,8 +2,6 @@ use crate::error::TypeConversionError;
use proto::message::primitive::pgoid::PgOid; use proto::message::primitive::pgoid::PgOid;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::cmp::Ordering; use std::cmp::Ordering;
// TODO: Private???
// use bincode::{Encode, Encoder, EncodeError, Decode, Decoder, DecodeError};
use bincode::{Encode, Decode}; use bincode::{Encode, Decode};
// ==============Types================ // ==============Types================
@ -92,7 +90,6 @@ impl PartialOrd for Value {
} }
} }
// TODO: Make column know about indexable types
impl Ord for Value { impl Ord for Value {
fn cmp(&self, other: &Self) -> Ordering { fn cmp(&self, other: &Self) -> Ordering {
match (self, other) { match (self, other) {
@ -120,18 +117,6 @@ impl Ord for Value {
} }
} }
// impl Encode for Value {
// fn encode<E: Encoder>(&self, encoder: &mut E) -> Result<(), EncodeError> {
// todo!()
// }
// }
// impl Decode for Value {
// fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, DecodeError> {
// todo!()
// }
// }
impl DbType { impl DbType {
fn new_n_option(n: usize, inside: DbType) -> DbType { fn new_n_option(n: usize, inside: DbType) -> DbType {
if n == 0 { if n == 0 {

View file

@ -6,8 +6,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
nom-peg = "0.1.1" bimap = { workspace = true }
nom = "7.1.3" nom = "7.1.3"
nom-peg = "0.1.1"
thiserror = { workspace = true }
minisql = { path = "../minisql" } minisql = { path = "../minisql" }
bimap = "0.6.3"
thiserror = "1"

View file

@ -4,10 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
bincode = "2.0.0-rc.3" async-trait = { workspace = true }
tokio = { version = "1.34.0", features = ["io-util", "macros", "test-util"] } bincode = { workspace = true }
async-trait = "0.1.74" rand = { workspace = true }
thiserror = "1.0.50"
rand_seeder = "0.2.3"
rand_pcg = "0.3.1" rand_pcg = "0.3.1"
rand = "0.8.5" rand_seeder = "0.2.3"
thiserror = { workspace = true }
tokio = { workspace = true, features = ["io-util", "macros"] }

View file

@ -6,12 +6,12 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
tokio = { version = "1.35.1", features = ["full"] } anyhow = { workspace = true }
anyhow = "1.0.76" async-trait = { workspace = true }
clap = { version = "4.4.18", features = ["derive"] } clap = { workspace = true, features = ["derive"] }
async-trait = "0.1.74" rand = { workspace = true }
rand = "0.8.5" tokio = { workspace = true, features = ["io-util", "macros", "net", "rt-multi-thread", "time"] }
serde_json = "1.0.112"
minisql = { path = "../minisql" } minisql = { path = "../minisql" }
proto = { path = "../proto" }
parser = { path = "../parser" } parser = { path = "../parser" }
proto = { path = "../proto" }

View file

@ -85,7 +85,7 @@ async fn handle_stream(
let mut wrapped_writer = ServerProtoWrapper::new(writer, config.get_throttle()); let mut wrapped_writer = ServerProtoWrapper::new(writer, config.get_throttle());
let result = match request { let result = match request {
Ok(req) => { Ok(req) => {
handle_connection(&mut reader, &mut wrapped_writer, req, state, token, config).await handle_connection(&mut reader, &mut wrapped_writer, req, state, token).await
} }
Err(ServerHandshakeError::IsCancelRequest(cancel)) => { Err(ServerHandshakeError::IsCancelRequest(cancel)) => {
handle_cancellation(cancel.pid, cancel.secret, &tokens).await handle_cancellation(cancel.pid, cancel.secret, &tokens).await
@ -141,7 +141,6 @@ async fn handle_connection<R, W>(
request: HandshakeRequest, request: HandshakeRequest,
state: SharedDbState, state: SharedDbState,
token: ResetCancelToken, token: ResetCancelToken,
config: Arc<Configuration>,
) -> anyhow::Result<()> ) -> anyhow::Result<()>
where where
R: FrontendProtoReader + Send, R: FrontendProtoReader + Send,
@ -157,7 +156,7 @@ where
break; break;
} }
FrontendMessage::Query(data) => { FrontendMessage::Query(data) => {
let result = handle_query(writer, &state, data.query.into(), &token, &config).await; let result = handle_query(writer, &state, data.query.into(), &token).await;
match result { match result {
Ok(_) => {} Ok(_) => {}
Err(e) => writer.write_error_message(&e.to_string()).await?, Err(e) => writer.write_error_message(&e.to_string()).await?,
@ -176,7 +175,6 @@ async fn handle_query<W>(
state: &SharedDbState, state: &SharedDbState,
query: String, query: String,
token: &ResetCancelToken, token: &ResetCancelToken,
config: &Arc<Configuration>,
) -> anyhow::Result<()> ) -> anyhow::Result<()>
where where
W: BackendProtoWriter + ProtoFlush + Send, W: BackendProtoWriter + ProtoFlush + Send,

View file

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
bincode = "2.0.0-rc.3" async-trait = { workspace = true }
tokio = { version = "1.34.0", features = ["full"] } bincode = { workspace = true }
async-trait = "0.1.74" thiserror = { workspace = true }
thiserror = "1.0.50" tokio = { workspace = true, features = ["fs", "io-util", "macros", "rt-multi-thread"] }

View file

@ -16,7 +16,6 @@ pub type Result<T> = std::result::Result<T, Error>;
pub type Column = u64; pub type Column = u64;
pub type FilePosition = u64; pub type FilePosition = u64;
// TODO: Consider adding another type parameter for indexable values
#[derive(Debug)] #[derive(Debug)]
pub struct Store<T> { pub struct Store<T> {
pub header: StoreHeader, pub header: StoreHeader,