Compare commits

...

3 Commits

Author SHA1 Message Date
7f7615870a chore(deps): update all dependencies
Some checks failed
renovate/artifacts Artifact file update failure
2024-10-17 00:28:22 +00:00
5cf5519524
feat: remove sqlx
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-10-16 19:49:46 +02:00
74b81c9762
feat: remove crdb from rust-service
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-10-16 14:16:47 +02:00
8 changed files with 12 additions and 54 deletions

View File

@ -26,7 +26,7 @@ simple_logger = "5.0.0"
thiserror = "1" thiserror = "1"
tokio = { version = "1.37.0", features = ["full"] } tokio = { version = "1.37.0", features = ["full"] }
tower = { version = "0.5.0", features = ["full"] } tower = { version = "0.5.0", features = ["full"] }
tower-http = { version = "0.5", features = ["full"] } tower-http = { version = "0.6", features = ["full"] }
wasm-bindgen = "=0.2.93" wasm-bindgen = "=0.2.93"
# See https://github.com/akesson/cargo-leptos for documentation of all the parameters. # See https://github.com/akesson/cargo-leptos for documentation of all the parameters.

View File

@ -215,9 +215,7 @@
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
"@types/node@^20": "@types/node@^20":
version "20.12.4" version "20.16.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.4.tgz#af5921bd75ccdf3a3d8b3fa75bf3d3359268cd11"
integrity sha512-E+Fa9z3wSQpzgYQdYmme5X3OTuejnnTx88A6p6vkkJosR3KBz+HpE3kqNm98VE6cfLFcISx7zW7MsJkH6KwbTw==
dependencies: dependencies:
undici-types "~5.26.4" undici-types "~5.26.4"
@ -474,9 +472,7 @@ ast-types-flow@^0.0.8:
integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ== integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==
autoprefixer@^10.0.1: autoprefixer@^10.0.1:
version "10.4.19" version "10.4.20"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.19.tgz#ad25a856e82ee9d7898c59583c1afeb3fa65f89f"
integrity sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==
dependencies: dependencies:
browserslist "^4.23.0" browserslist "^4.23.0"
caniuse-lite "^1.0.30001599" caniuse-lite "^1.0.30001599"
@ -2106,9 +2102,7 @@ postcss@8.4.31:
source-map-js "^1.0.2" source-map-js "^1.0.2"
postcss@^8, postcss@^8.4.23: postcss@^8, postcss@^8.4.23:
version "8.4.38" version "8.4.47"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e"
integrity sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==
dependencies: dependencies:
nanoid "^3.3.7" nanoid "^3.3.7"
picocolors "^1.0.0" picocolors "^1.0.0"
@ -2486,9 +2480,7 @@ supports-preserve-symlinks-flag@^1.0.0:
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
tailwindcss@^3.3.0: tailwindcss@^3.3.0:
version "3.4.3" version "3.4.14"
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.3.tgz#be48f5283df77dfced705451319a5dffb8621519"
integrity sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==
dependencies: dependencies:
"@alloc/quick-lru" "^5.2.0" "@alloc/quick-lru" "^5.2.0"
arg "^5.0.2" arg "^5.0.2"
@ -2626,9 +2618,7 @@ typed-array-length@^1.0.6:
possible-typed-array-names "^1.0.0" possible-typed-array-names "^1.0.0"
typescript@^5: typescript@^5:
version "5.4.4" version "5.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.4.tgz#eb2471e7b0a5f1377523700a21669dce30c2d952"
integrity sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==
unbox-primitive@^1.0.2: unbox-primitive@^1.0.2:
version "1.0.2" version "1.0.2"

View File

@ -14,6 +14,6 @@ dotenv.workspace = true
axum.workspace = true axum.workspace = true
serde = { version = "1.0.197", features = ["derive"] } serde = { version = "1.0.197", features = ["derive"] }
sqlx = { version = "0.7.3", features = ["runtime-tokio", "tls-rustls", "postgres", "uuid", "time"] } sqlx = { version = "0.8.0", features = ["runtime-tokio", "tls-rustls", "postgres", "uuid", "time"] }
uuid = { version = "1.7.0", features = ["v4"] } uuid = { version = "1.7.0", features = ["v4"] }
tower-http = { version = "0.5.2", features = ["cors", "trace"] } tower-http = { version = "0.6.0", features = ["cors", "trace"] }

View File

@ -1 +1 @@
DATABASE_URL="postgres://root@localhost:26257/defaultdb?sslmode=disable"

View File

@ -13,6 +13,5 @@ dotenv.workspace = true
axum.workspace = true axum.workspace = true
serde = { version = "1.0.197", features = ["derive"] } serde = { version = "1.0.197", features = ["derive"] }
sqlx = { version = "0.7.3", features = ["runtime-tokio", "tls-rustls", "postgres", "uuid", "time"] }
uuid = { version = "1.7.0", features = ["v4"] } uuid = { version = "1.7.0", features = ["v4"] }
tower-http = { version = "0.5.2", features = ["cors", "trace"] } tower-http = { version = "0.6.0", features = ["cors", "trace"] }

View File

@ -1 +0,0 @@
-- Add migration script here

View File

@ -6,7 +6,6 @@ use axum::http::Request;
use axum::Router; use axum::Router;
use axum::routing::get; use axum::routing::get;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use sqlx::{Pool, Postgres};
use tower_http::trace::TraceLayer; use tower_http::trace::TraceLayer;
#[derive(Parser)] #[derive(Parser)]
@ -82,25 +81,11 @@ impl Deref for SharedState {
} }
} }
pub struct State { pub struct State {}
pub db: Pool<Postgres>,
}
impl State { impl State {
pub async fn new() -> anyhow::Result<Self> { pub async fn new() -> anyhow::Result<Self> {
let db = sqlx::PgPool::connect( Ok(Self {})
&std::env::var("DATABASE_URL").context("DATABASE_URL is not set")?,
)
.await?;
sqlx::migrate!("migrations/crdb")
.set_locking(false)
.run(&db)
.await?;
let _ = sqlx::query("SELECT 1;").fetch_one(&db).await?;
Ok(Self { db })
} }
} }

View File

@ -1,15 +0,0 @@
version: "3"
services:
crdb:
restart: 'always'
image: 'cockroachdb/cockroach:v23.1.14'
command: 'start-single-node --advertise-addr 0.0.0.0 --insecure'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]
interval: '10s'
timeout: '30s'
retries: 5
start_period: '20s'
ports:
- 8080:8080
- '26257:26257'