Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use csv to parse csv files #7

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,172 changes: 1,267 additions & 905 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ authors = ["aravk <[email protected]>"]
edition = "2021"

[dependencies]
dotenv = "0.15"
regex = "1.4"
argon2 = "0.3"
rand = "0.8.3"
rocket = { version = "0.4.10", features = ["private-cookies"] }
rocket_contrib = { version = "0.4.10", features = ["tera_templates"] }
multipart = "0.17.1"
zip = { version = "0.5.9", default-features = false, features = ["deflate"] }
rusqlite = { version = "0.24.2", features = ["bundled"] }
postgres = { version = "0.19", features = ["with-chrono-0_4"] }
postgres-native-tls = "0.5"
native-tls = "0.2.7"
chrono = "0.4"
uuid = { version = "0.8.2", features = ["v4"] }
serde = "1.0"
serde_derive = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
reqwest = { version = "0.11", features = ["blocking", "json"] }
rocket = { version = "0.5.0-rc.2", features = ["secrets", "json"] }
rocket_dyn_templates = { version = "0.1.0-rc.2", features = ["tera"] }
sqlx = { version = "0.5", features = ["postgres", "sqlite", "tls", "migrate", "macros", "time"] }
rocket_db_pools = { version = "0.1.0-rc.2", features = ["sqlx_postgres", "sqlx_sqlite"] }
log = "0.4"
csv = "1.1.6"

[profile.dev.package.sqlx-macros]
opt-level = 3
6 changes: 6 additions & 0 deletions Rocket.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[default.limits]
data-form = "7 MiB"
file = "4 MiB"

[default.databases.fixes]
url = "postgres://postgres:password@localhost:5432/sakubun"
5 changes: 5 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// generated by `sqlx migrate build-script`
fn main() {
// trigger recompilation when a new migration is added
println!("cargo:rerun-if-changed=migrations");
}
16 changes: 16 additions & 0 deletions migrations/20220829063159_initial_migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS overrides (
id serial PRIMARY KEY,
sentence_id INTEGER NOT NULL,
override_type VARCHAR NOT NULL,
value VARCHAR NOT NULL,
primary_value BOOLEAN NOT NULL DEFAULT FALSE
);

CREATE TABLE IF NOT EXISTS reports (
id serial PRIMARY KEY,
sentence_id INTEGER NOT NULL,
report_type VARCHAR NOT NULL,
suggested VARCHAR (500),
comment VARCHAR (500),
reported_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
1 change: 0 additions & 1 deletion rust-toolchain

This file was deleted.

Loading