feat: add cli package

This commit is contained in:
Max Hohlfeld 2024-12-17 16:02:45 +01:00
parent 0844cc5a17
commit 9a6c714d74
7 changed files with 34 additions and 2 deletions

4
.cargo/config.toml Normal file
View File

@ -0,0 +1,4 @@
[alias]
db = ["run", "--package", "cli", "--bin", "db", "--"]
w = ["watch", "--exec", "run"]
t = ["nextest", "run"]

4
Cargo.lock generated
View File

@ -825,6 +825,10 @@ dependencies = [
"inout", "inout",
] ]
[[package]]
name = "cli"
version = "0.1.0"
[[package]] [[package]]
name = "concurrent-queue" name = "concurrent-queue"
version = "2.5.0" version = "2.5.0"

View File

@ -1,5 +1,5 @@
[workspace] [workspace]
members = [ "config", "macros", "web", ] members = [ "cli", "config", "macros", "web", ]
resolver = "2" resolver = "2"
default-members = ["web"] default-members = ["web"]

View File

@ -29,7 +29,7 @@ rc_reload=NO
``` ```
``` ```ini
# Postgres # Postgres
# DATABASE_URL=postgres://postgres@localhost/my_database # DATABASE_URL=postgres://postgres@localhost/my_database
# SQLite # SQLite
@ -46,3 +46,11 @@ SMTP_PORT="25"
# SMTP_PASSWORD="" # SMTP_PASSWORD=""
SMTP_TLSTYPE="none" SMTP_TLSTYPE="none"
``` ```
## drop test databases
```bash
for dbname in $(psql -c "copy (select datname from pg_database where datname like 'brass_test_%') to stdout") ; do
echo "$dbname"
#dropdb -i "$dbname"
done
```

12
cli/Cargo.toml Normal file
View File

@ -0,0 +1,12 @@
[package]
name = "cli"
version = "0.1.0"
edition = "2021"
[lib]
[[bin]]
name = "db"
path = "src/db.rs"
[dependencies]

3
cli/src/db.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
println!("abc");
}

1
cli/src/lib.rs Normal file
View File

@ -0,0 +1 @@
pub mod db;