Compare commits
4 commits
ab5b2a4ac7
...
47b72f6f04
Author | SHA1 | Date | |
---|---|---|---|
47b72f6f04 | |||
b8d8b2918a | |||
a831d4fc61 | |||
eeac5f2575 |
7 changed files with 728 additions and 17 deletions
5
.lazy.lua
Normal file
5
.lazy.lua
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
vim.g.dbs = {
|
||||||
|
dev = "sqlite:testing.db",
|
||||||
|
}
|
||||||
|
|
||||||
|
return {}
|
10
.sqlfluff
Normal file
10
.sqlfluff
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[sqlfluff]
|
||||||
|
dialect = sqlite
|
||||||
|
|
||||||
|
[sqlfluff:layout:type:column_constraint_segment]
|
||||||
|
spacing_before = align
|
||||||
|
align_within = create_table_statement
|
||||||
|
|
||||||
|
[sqlfluff:layout:type:data_type]
|
||||||
|
spacing_before = align
|
||||||
|
align_within = create_table_statement
|
717
Cargo.lock
generated
717
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -38,6 +38,7 @@ tower = { version = "0.5.0", features = ["util"] }
|
||||||
tower-http = { version = "0.5.0", features = ["fs", "trace", "limit"] }
|
tower-http = { version = "0.5.0", features = ["fs", "trace", "limit"] }
|
||||||
tracing = "0.1.37"
|
tracing = "0.1.37"
|
||||||
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
|
||||||
|
sqlx = { version = "0.8.2", features = ["runtime-tokio", "chrono"] }
|
||||||
|
|
||||||
# I want to use askama's block feature, this requires unreleased 0.13
|
# I want to use askama's block feature, this requires unreleased 0.13
|
||||||
[dependencies.askama]
|
[dependencies.askama]
|
||||||
|
|
2
migrations/20241115182043_init.down.sql
Normal file
2
migrations/20241115182043_init.down.sql
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
-- Add down migration script here
|
||||||
|
DROP TABLE IF EXISTS records;
|
8
migrations/20241115182043_init.up.sql
Normal file
8
migrations/20241115182043_init.up.sql
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
-- Add up migration script here
|
||||||
|
CREATE TABLE IF NOT EXISTS records (
|
||||||
|
id INTEGER PRIMARY KEY,
|
||||||
|
uploaded TEXT NOT NULL,
|
||||||
|
file_path TEXT NOT NULL,
|
||||||
|
downloads INTEGER NOT NULL DEFAULT 0,
|
||||||
|
max_downloads INTEGER NOT NULL
|
||||||
|
) STRICT;
|
|
@ -74,8 +74,8 @@ async fn upload_to_zip(
|
||||||
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
|
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut records = state.records.lock().await;
|
|
||||||
let record = UploadRecord::new(archive_path);
|
let record = UploadRecord::new(archive_path);
|
||||||
|
let mut records = state.records.lock().await;
|
||||||
records.insert(cache_name.clone(), record.clone());
|
records.insert(cache_name.clone(), record.clone());
|
||||||
|
|
||||||
let records_cache = records.clone();
|
let records_cache = records.clone();
|
||||||
|
|
Loading…
Reference in a new issue