Compare commits

..

3 Commits

Author SHA1 Message Date
28b7e0cd46 chore(deps): update dependency @playwright/test to v1.48.1 2024-10-17 00:28:31 +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
6 changed files with 25 additions and 57 deletions

View File

@ -13,12 +13,12 @@
} }
}, },
"node_modules/@playwright/test": { "node_modules/@playwright/test": {
"version": "1.48.0", "version": "1.48.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.0.tgz", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.1.tgz",
"integrity": "sha512-W5lhqPUVPqhtc/ySvZI5Q8X2ztBOUgZ8LbAFy0JQgrXZs2xaILrUcNO3rQjwbLPfGK13+rZsDa1FpG+tqYkT5w==", "integrity": "sha512-s9RtWoxkOLmRJdw3oFvhFbs9OJS0BzrLUc8Hf6l2UdCNd1rqeEyD4BhCJkvzeEoD1FsK4mirsWwGerhVmYKtZg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"playwright": "1.48.0" "playwright": "1.48.1"
}, },
"bin": { "bin": {
"playwright": "cli.js" "playwright": "cli.js"
@ -42,12 +42,12 @@
} }
}, },
"node_modules/playwright": { "node_modules/playwright": {
"version": "1.48.0", "version": "1.48.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.0.tgz", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.1.tgz",
"integrity": "sha512-qPqFaMEHuY/ug8o0uteYJSRfMGFikhUysk8ZvAtfKmUK3kc/6oNl/y3EczF8OFGYIi/Ex2HspMfzYArk6+XQSA==", "integrity": "sha512-j8CiHW/V6HxmbntOfyB4+T/uk08tBy6ph0MpBXwuoofkSnLmlfdYNNkFTYD6ofzzlSqLA1fwH4vwvVFvJgLN0w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"playwright-core": "1.48.0" "playwright-core": "1.48.1"
}, },
"bin": { "bin": {
"playwright": "cli.js" "playwright": "cli.js"
@ -60,9 +60,9 @@
} }
}, },
"node_modules/playwright-core": { "node_modules/playwright-core": {
"version": "1.48.0", "version": "1.48.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.0.tgz", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.1.tgz",
"integrity": "sha512-RBvzjM9rdpP7UUFrQzRwR8L/xR4HyC1QXMzGYTbf1vjw25/ya9NRAVnXi/0fvFopjebvyPzsmoK58xxeEOaVvA==", "integrity": "sha512-Yw/t4VAFX/bBr1OzwCuOMZkY1Cnb4z/doAFSwf4huqAGWmf9eMNjmK7NiOljCdLmxeRYcGPPmcDgU0zOlzP0YA==",
"dev": true, "dev": true,
"bin": { "bin": {
"playwright-core": "cli.js" "playwright-core": "cli.js"
@ -74,12 +74,12 @@
}, },
"dependencies": { "dependencies": {
"@playwright/test": { "@playwright/test": {
"version": "1.48.0", "version": "1.48.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.0.tgz", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.1.tgz",
"integrity": "sha512-W5lhqPUVPqhtc/ySvZI5Q8X2ztBOUgZ8LbAFy0JQgrXZs2xaILrUcNO3rQjwbLPfGK13+rZsDa1FpG+tqYkT5w==", "integrity": "sha512-s9RtWoxkOLmRJdw3oFvhFbs9OJS0BzrLUc8Hf6l2UdCNd1rqeEyD4BhCJkvzeEoD1FsK4mirsWwGerhVmYKtZg==",
"dev": true, "dev": true,
"requires": { "requires": {
"playwright": "1.48.0" "playwright": "1.48.1"
} }
}, },
"fsevents": { "fsevents": {
@ -90,19 +90,19 @@
"optional": true "optional": true
}, },
"playwright": { "playwright": {
"version": "1.48.0", "version": "1.48.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.0.tgz", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.1.tgz",
"integrity": "sha512-qPqFaMEHuY/ug8o0uteYJSRfMGFikhUysk8ZvAtfKmUK3kc/6oNl/y3EczF8OFGYIi/Ex2HspMfzYArk6+XQSA==", "integrity": "sha512-j8CiHW/V6HxmbntOfyB4+T/uk08tBy6ph0MpBXwuoofkSnLmlfdYNNkFTYD6ofzzlSqLA1fwH4vwvVFvJgLN0w==",
"dev": true, "dev": true,
"requires": { "requires": {
"fsevents": "2.3.2", "fsevents": "2.3.2",
"playwright-core": "1.48.0" "playwright-core": "1.48.1"
} }
}, },
"playwright-core": { "playwright-core": {
"version": "1.48.0", "version": "1.48.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.0.tgz", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.1.tgz",
"integrity": "sha512-RBvzjM9rdpP7UUFrQzRwR8L/xR4HyC1QXMzGYTbf1vjw25/ya9NRAVnXi/0fvFopjebvyPzsmoK58xxeEOaVvA==", "integrity": "sha512-Yw/t4VAFX/bBr1OzwCuOMZkY1Cnb4z/doAFSwf4huqAGWmf9eMNjmK7NiOljCdLmxeRYcGPPmcDgU0zOlzP0YA==",
"dev": true "dev": true
} }
} }

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.5.2", 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'