1
0
mirror of https://github.com/bitwarden/server synced 2026-01-30 16:23:37 +00:00

Smallest possible test of sql server with a publisher crate

This commit is contained in:
Matt Gibson
2025-10-21 13:36:17 -07:00
parent bbd1a230a6
commit 0309aae4d7
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
[package]
name = "publisher"
edition.workspace = true
version.workspace = true
authors.workspace = true
license-file.workspace = true
keywords.workspace = true
[dependencies]
akd_storage = { path = "../akd_storage" }
tokio-util = {version = "0.7.16", features = ["compat"] }
tokio = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
async-std = {version = "1.13.2", features = ["attributes"] }
[target.'cfg(target_os = "macos")'.dependencies]
tiberius = { version = "0.12.3", default-features = false, features = ["chrono", "tokio", "rustls"] }
[target.'cfg(not(target_os = "macos"))'.workspace.dependencies]
tiberius = { version = "0.12.3", features = ["chrono", "tokio"] }
[lints]
workspace = true

View File

@@ -0,0 +1,19 @@
use tracing::{info, trace};
#[tokio::main]
async fn main() {
tracing_subscriber::fmt()
.with_max_level(tracing::Level::TRACE)
.init();
// Read connection string from env var
let connection_string = std::env::var("AKD_MSSQL_CONNECTION_STRING").expect("AKD_MSSQL_CONNECTION_STRING must be set.");
let mssql = akd_storage::ms_sql::MsSql::builder(connection_string)
.pool_size(10)
.build()
.await
.expect("Failed to create MsSql instance");
mssql.migrate().await.expect("Failed to run migrations");
}