mirror of
https://codeberg.org/icewind/log-archiver.git
synced 2026-06-03 17:44:06 +02:00
offline sqlx
This commit is contained in:
parent
6f1f50f0f0
commit
d384781db3
4 changed files with 52 additions and 2 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
|
@ -201,6 +201,9 @@ name = "either"
|
||||||
version = "1.6.1"
|
version = "1.6.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "encoding_rs"
|
name = "encoding_rs"
|
||||||
|
|
@ -1182,9 +1185,13 @@ dependencies = [
|
||||||
"either",
|
"either",
|
||||||
"futures",
|
"futures",
|
||||||
"heck",
|
"heck",
|
||||||
|
"hex",
|
||||||
|
"once_cell",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"sha2",
|
||||||
"sqlx-core",
|
"sqlx-core",
|
||||||
"sqlx-rt",
|
"sqlx-rt",
|
||||||
"syn",
|
"syn",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ authors = ["Robin Appelman <robin@icewind.nl>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sqlx = { version = "0.5", default_features = false, features = ["macros", "postgres", "json", "runtime-actix-rustls"] }
|
sqlx = { version = "0.5", default_features = false, features = ["macros", "postgres", "json", "runtime-actix-rustls", "offline"] }
|
||||||
dotenv = "0.15"
|
dotenv = "0.15"
|
||||||
main_error = "0.1"
|
main_error = "0.1"
|
||||||
tokio = { version = "1", features = ["macros", "time"] }
|
tokio = { version = "1", features = ["macros", "time"] }
|
||||||
|
|
|
||||||
11
Dockerfile
11
Dockerfile
|
|
@ -1,6 +1,15 @@
|
||||||
FROM ekidd/rust-musl-builder AS build
|
FROM ekidd/rust-musl-builder AS build
|
||||||
|
|
||||||
ADD . ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
|
||||||
|
# Build with a dummy main to pre-build dependencies
|
||||||
|
RUN mkdir src && \
|
||||||
|
echo "fn main(){}" > src/main.rs && \
|
||||||
|
cargo build --release && \
|
||||||
|
rm -r src
|
||||||
|
|
||||||
|
COPY src/ ./src/
|
||||||
|
COPY sqlx-data.json ./
|
||||||
RUN sudo chown -R rust:rust .
|
RUN sudo chown -R rust:rust .
|
||||||
|
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
|
||||||
34
sqlx-data.json
Normal file
34
sqlx-data.json
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"db": "PostgreSQL",
|
||||||
|
"bcd0843c15afc0443df1ab40d7d0c5632ab9d025cdcf3646f4e9d5872b7c8c89": {
|
||||||
|
"query": "INSERT INTO logs_raw(id, json) VALUES($1, $2)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Int4",
|
||||||
|
"Jsonb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"e4dfb1fbca2c91ac837d11aff64e035ccce38867e3503653ec2ef28eeeb8907d": {
|
||||||
|
"query": "SELECT MAX(id) AS last_archived FROM logs_raw",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "last_archived",
|
||||||
|
"type_info": "Int4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue