v0.2.0
This commit is contained in:
1 parent
fc81ecafd6
commit
dc57aa7089
89 files changed
+5290
-1551
No files matched your search
@@ -160,12 +160,14 @@ pub mod db_drafts {
|
||||
pub const Q_004: &str = "UPDATE drafts SET remote_folder = $2, remote_uid = $3, remote_uid_validity = $4 WHERE id = $1";
|
||||
pub const Q_005: &str = "DELETE FROM drafts WHERE id = $1";
|
||||
pub const Q_006: &str =
|
||||
"INSERT INTO draft_attachments (id, draft_id, filename, content_type, size, file_path)
|
||||
VALUES ($1, $2, $3, $4, $5, $6)";
|
||||
"INSERT INTO draft_attachments (id, draft_id, filename, content_type, size, file_path, checksum_sha256)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7)";
|
||||
pub const Q_007: &str =
|
||||
"SELECT id, draft_id, filename, content_type, size, file_path, created_at
|
||||
"SELECT id, draft_id, filename, content_type, size, file_path, checksum_sha256, created_at
|
||||
FROM draft_attachments WHERE draft_id = $1 ORDER BY created_at ASC";
|
||||
pub const Q_008: &str = "DELETE FROM draft_attachments WHERE id = $1";
|
||||
pub const Q_009: &str =
|
||||
"UPDATE draft_attachments SET file_path=$1, checksum_sha256=$2 WHERE id=$3";
|
||||
}
|
||||
|
||||
pub mod db_folder_preferences {
|
||||
@@ -499,3 +501,13 @@ pub mod sessions {
|
||||
pub const DELETE_EXPIRED: &str =
|
||||
"DELETE FROM sessions WHERE last_accessed_unix + timeout_secs < $1";
|
||||
}
|
||||
|
||||
pub mod db_search_outbox {
|
||||
pub const Q_001: &str = "INSERT INTO search_outbox (id, generation, event_type, message_uid, folder, payload, attempts, available_at, dead_letter, last_error, created_at, updated_at) VALUES ($1, $2, $3, $4, $5, $6, 0, 0, 0, NULL, $7, $7) ON CONFLICT(id) DO UPDATE SET generation=excluded.generation, event_type=excluded.event_type, message_uid=excluded.message_uid, folder=excluded.folder, payload=excluded.payload, attempts=0, available_at=0, dead_letter=0, last_error=NULL, created_at=excluded.created_at, updated_at=excluded.updated_at";
|
||||
pub const Q_002: &str = "SELECT id, generation, event_type, message_uid, folder, payload, attempts, created_at, updated_at FROM search_outbox WHERE dead_letter=0 AND available_at <= $1 AND claimed_until <= $1 ORDER BY updated_at ASC LIMIT $2";
|
||||
pub const Q_003: &str = "DELETE FROM search_outbox WHERE id=$1 AND generation=$2";
|
||||
pub const Q_004: &str = "UPDATE search_outbox SET attempts=$3, available_at=$4, claimed_until=0, dead_letter=$5, last_error=$6, updated_at=$7 WHERE id=$1 AND generation=$2";
|
||||
pub const Q_005: &str = "SELECT COUNT(*), COALESCE(SUM(CASE WHEN dead_letter <> 0 THEN 1 ELSE 0 END), 0), COALESCE(MIN(CASE WHEN dead_letter = 0 THEN created_at ELSE NULL END), 0) FROM search_outbox";
|
||||
pub const Q_006: &str = "UPDATE search_outbox SET claimed_until=$3 WHERE id=$1 AND generation=$2 AND dead_letter=0 AND available_at <= $4 AND claimed_until <= $4";
|
||||
pub const Q_007: &str = "DELETE FROM search_outbox WHERE updated_at < $1";
|
||||
}
|
||||
Reference in new issue
Block a user