diff --git a/Cargo.lock b/Cargo.lock index 26ca050..06d0e9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,6 +247,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + [[package]] name = "filetime" version = "0.2.22" @@ -437,6 +443,15 @@ dependencies = [ "libc", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -540,6 +555,12 @@ dependencies = [ "notify", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniweb" version = "0.1.0" @@ -556,6 +577,7 @@ dependencies = [ "pulldown-cmark", "rust-embed", "serde", + "sqlformat", "tokio", ] @@ -580,6 +602,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "notify" version = "5.2.0" @@ -935,6 +967,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "sqlformat" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" +dependencies = [ + "itertools", + "nom", + "unicode_categories", +] + [[package]] name = "syn" version = "2.0.37" @@ -1064,6 +1107,12 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index 4157837..bbf8934 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,14 +5,16 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[featues] +[features] # https://github.com/rust-db/barrel/blob/master/guides/diesel-setup.md -use_barrel = [] +use_barrel = ["barrel", "sqlformat"] +default = ["use_barrel"] [dependencies] +sqlformat = { version = "0.2.2", optional = true } anyhow = "1.0.75" axum = "0.6.20" -barrel = { version = "0.7.0", optional = true } +barrel = { version = "0.7.0", optional = true, features = ["pg"] } diesel = { version = "2.1.3", features = ["serde_json", "postgres"] } dotenvy = "0.15.7" mime_guess = "2.0.4" diff --git a/Justfile b/Justfile index 6206c25..f3a8f66 100644 --- a/Justfile +++ b/Justfile @@ -20,4 +20,7 @@ pg-down: dev-install: cargo install diesel_cli --no-default-features --features="postgres" + +dev-reset: + diesel migration revert --all \ No newline at end of file