Switch to Postgres (#39)

* WIP Switch to Postgres

* feat(postgres): more work on porting to postgres, now compiles

* feat(docker-compose): Changed the docker-compose.yml file to use postgres.

* Update docker, documentation, gh actions...

* Remove bson dependency

* Remove bson import

* feat: move mock filehost to trait rather than cargo feature

* feat(postgres): transactions for mod creation, multipart refactor

* fix: Add Cargo.lock so that sqlx functions

* Update sqlx offline build data

* fix: Use SQLX_OFFLINE to force sqlx into offline mode for CI

* Default release channels

* feat(postgres): refactor database models to fit postgres models

* fix: Fix sqlx prepare, fix double allocation in indexing

* Add dockerfile (#40)

Co-authored-by: Charalampos Fanoulis <charalampos.fanoulis@gmail.com>

Co-authored-by: Aeledfyr <aeledfyr@gmail.com>
Co-authored-by: redblueflame <contact@redblueflame.com>
Co-authored-by: Jai A <jai.a@tuta.io>
Co-authored-by: Valentin Ricard <redblueflame1@gmail.Com>
Co-authored-by: Charalampos Fanoulis <charalampos.fanoulis@gmail.com>
This commit is contained in:
AppleTheGolden
2020-07-23 22:46:33 +02:00
committed by GitHub
parent 95339a8338
commit ee69653a83
47 changed files with 4363 additions and 694 deletions

View File

@@ -1,19 +1,6 @@
pub mod models;
mod mongo_database;
mod postgres_database;
pub use models::Mod;
pub use models::Version;
pub use mongo_database::connect;
use thiserror::Error;
type Result<T> = std::result::Result<T, DatabaseError>;
#[derive(Error, Debug)]
pub enum DatabaseError {
#[error("Impossible to find document")]
NotFound(),
#[error("BSON deserialization error")]
BsonError(#[from] bson::de::Error),
#[error("Local database error")]
LocalDatabaseError(#[from] mongodb::error::Error),
}
pub use postgres_database::connect;