open-keychain/OpenKeychain/src/main/sqldelight/org/sufficientlysecure/keychain/KeyRingsPublic.sq
Vincent Breitmoser e3e5f7feec use explicit order for insert operations
This prevents a problem from different column orders in database tables.
In particular, this occurred with the user_packets table, where the `rank` column moved up in order.
2018-07-14 13:05:08 +02:00

20 lines
454 B
Plaintext

CREATE TABLE IF NOT EXISTS keyrings_public (
master_key_id INTEGER NOT NULL PRIMARY KEY,
key_ring_data BLOB NULL
);
insertKeyRingPublic:
INSERT INTO keyrings_public (master_key_id, key_ring_data) VALUES (?, ?);
selectAllMasterKeyIds:
SELECT master_key_id
FROM keyrings_public;
selectByMasterKeyId:
SELECT *
FROM keyrings_public
WHERE master_key_id = ?;
deleteByMasterKeyId:
DELETE FROM keyrings_public
WHERE master_key_id = ?;