Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

basic replication #525

Merged
merged 5 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions libsqlx-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ edition = "2021"

[dependencies]
async-bincode = { version = "0.7.1", features = ["tokio"] }
async-trait = "0.1.71"
axum = "0.6.18"
base64 = "0.21.2"
bincode = "1.3.3"
bytes = "1.4.0"
bytes = { version = "1.4.0", features = ["serde"] }
clap = { version = "4.3.11", features = ["derive"] }
color-eyre = "0.6.2"
futures = "0.3.28"
Expand All @@ -26,6 +27,7 @@ regex = "1.9.1"
serde = { version = "1.0.166", features = ["derive", "rc"] }
serde_json = "1.0.100"
sha2 = "0.10.7"
sha3 = "0.10.8"
sled = "0.34.7"
thiserror = "1.0.43"
tokio = { version = "1.29.1", features = ["full"] }
Expand All @@ -34,7 +36,7 @@ tokio-util = "0.7.8"
toml = "0.7.6"
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
uuid = { version = "1.4.0", features = ["v4"] }
uuid = { version = "1.4.0", features = ["v4", "serde"] }

[dev-dependencies]
turmoil = "0.5.5"
6 changes: 4 additions & 2 deletions libsqlx-server/src/allocation/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use serde::{Deserialize, Serialize};

use crate::linc::NodeId;

/// Structural supertype of AllocConfig, used for checking the meta version. Subsequent version of
/// AllocConfig need to conform to this prototype.
#[derive(Debug, Serialize, Deserialize)]
Expand All @@ -10,12 +12,12 @@ struct ConfigVersion {
#[derive(Debug, Serialize, Deserialize)]
pub struct AllocConfig {
pub max_conccurent_connection: u32,
pub id: String,
pub db_name: String,
pub db_config: DbConfig,
}

#[derive(Debug, Serialize, Deserialize)]
pub enum DbConfig {
Primary {},
Replica { primary_node_id: String },
Replica { primary_node_id: NodeId },
}
Loading