feat: support pg storage (#2935)

* refactor: using tokio-postgres

* chore: update

* chore: update env

* chore: update

* chore: upgrade supabase and add logout button

* refactor: update

* chore: update

* refactor: using message queue to handle the pg connection

* refactor: move test

* refactor: update sql

* chore: create pg database when user login

* chore: update scheme

* chore: generic user service

* chore: update

* chore: create statistics

* chore: create snapshot

* chore: add test

* chore: add database cloud service

* chore: add document cloud service

* chore: update interface

* test: add document test

* refactor: document interface

* chore: fix test

* chore: update

* chore: update test

* test: add test

* test: add test

* test: add test

* chore: update collab rev

* fix: flutter analyzer

* chore: update

* chore: update

* chore: update

* fix: tests

* chore: update

* chore: update collab rev

* ci: rust fmt

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
Nathan.fooo
2023-07-05 20:57:09 +08:00
committed by GitHub
parent e0ad364fa3
commit edc7933c66
157 changed files with 5385 additions and 1338 deletions

View File

@ -149,8 +149,8 @@ pub enum ErrorCode {
#[error("Invalid date time format")]
InvalidDateTimeFormat = 47,
#[error("Invalid data")]
InvalidData = 49,
#[error("Invalid params")]
InvalidParams = 49,
#[error("Serde")]
Serde = 50,
@ -208,6 +208,12 @@ pub enum ErrorCode {
#[error("Apply actions is empty")]
ApplyActionsIsEmpty = 68,
#[error("Connect postgres database failed")]
PgConnectError = 69,
#[error("Postgres database error")]
PgDatabaseError = 70,
}
impl ErrorCode {

View File

@ -79,7 +79,7 @@ impl FlowyError {
static_flowy_error!(user_id, ErrorCode::UserIdInvalid);
static_flowy_error!(user_not_exist, ErrorCode::UserNotExist);
static_flowy_error!(text_too_long, ErrorCode::TextTooLong);
static_flowy_error!(invalid_data, ErrorCode::InvalidData);
static_flowy_error!(invalid_data, ErrorCode::InvalidParams);
static_flowy_error!(out_of_bounds, ErrorCode::OutOfBounds);
static_flowy_error!(serde, ErrorCode::Serde);
static_flowy_error!(field_record_not_found, ErrorCode::FieldRecordNotFound);