diff --git a/.dockerignore b/.dockerignore index 342ee83..9ea5249 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ target/ Dockerfile +data/ diff --git a/.gitignore b/.gitignore index eb4bd94..9c1dce0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ # will have compiled files and executables debug/ target/ +data/ +.envrc +.env # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html diff --git a/Cargo.toml b/Cargo.toml index e8e99ac..6b928dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ rstest = "0.18.2" thiserror = "1.0.56" axum = "0.7.3" tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread"] } +sqlx = { version = "0.7.3", features = ["tls-rustls", "runtime-tokio", "postgres"] } [dev-dependencies] pretty_assertions = "1.4.0" diff --git a/docker-compose.yml b/docker-compose.yml index bff08b7..9fd2bad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,3 +6,16 @@ services: image: fundsimulatorrs ports: - "3000:3000" + postgres: + image: postgres:16 + ports: + - "5432:5432" + volumes: + - db-data:/var/lib/postgresql/data + environment: + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + +volumes: + db-data: diff --git a/migrations/20240203114703_create_real_distributions_table.sql b/migrations/20240203114703_create_real_distributions_table.sql new file mode 100644 index 0000000..e34a1aa --- /dev/null +++ b/migrations/20240203114703_create_real_distributions_table.sql @@ -0,0 +1,5 @@ +-- Add migration script here +CREATE TABLE real_distributions( + name TEXT PRIMARY KEY, + data JSONB NOT NULL +);