mirror of
https://github.com/aziascreations/BakaShrot.git
synced 2026-11-23 20:58:46 +01:00
Moved the PureBasic version to OldSource/, Started the Rust rewrite in Source/
The rewrite's plan and decisions are in revamp.md. Steps 0 to 10 are done: the workspace and checks, bakashrot-proto, bakashrot-pki and bakashrot-cert, bakashrot-config, bakashrot-storage (schema v9), the server and the client library (every request but replication's, attachments and retention included), the C DLL with its C, PureBasic and Python bindings, and the bakashrot tool. Step 11 (replication) is next. OldSource/ is the old implementation, kept building and passing as the reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RwFeVTGs2SsufaH6zquzcb
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
// Changes from v1, on "data" only:
|
||||
// - UNIQUE (group_id, node_id, message_id), so a message id can't be stored twice.
|
||||
// Its index also serves (group_id, node_id) lookups, replacing v1's index on them.
|
||||
// - is_json, set by SQLite on insert, for JSON queries on message_data.
|
||||
//
|
||||
// Needs SQLite 3.38+ with its JSON functions (json_valid, ->>), see Storage.pbi.
|
||||
|
||||
table archives {
|
||||
// UTC Unix Timestamp after which this archived message should be deleted.
|
||||
delete_by integer [not null]
|
||||
|
||||
message_data text [not null]
|
||||
}
|
||||
|
||||
table data {
|
||||
group_id integer [not null]
|
||||
node_id integer [not null]
|
||||
message_id integer [not null]
|
||||
message_data text [not null]
|
||||
|
||||
// 1 if message_data is well-formed JSON, 0 otherwise.
|
||||
// Can't be written, SQLite computes it on insert and stores it.
|
||||
is_json integer [not null, note: 'GENERATED ALWAYS AS (json_valid(message_data)) STORED']
|
||||
|
||||
indexes {
|
||||
(group_id, node_id, message_id) [unique]
|
||||
message_id
|
||||
}
|
||||
}
|
||||
|
||||
// Create it, but we'll implement this later.
|
||||
table attachements {
|
||||
group_id integer [not null]
|
||||
node_id integer [not null]
|
||||
message_id integer [not null]
|
||||
attachement_data blob [not null]
|
||||
|
||||
indexes {
|
||||
(group_id, node_id)
|
||||
message_id
|
||||
}
|
||||
}
|
||||
|
||||
// Note, ignore it
|
||||
// msg_type TEXT GENERATED ALWAYS AS (data ->> '$.messageData.MsgType') VIRTUAL
|
||||
Reference in New Issue
Block a user