diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-02-10 18:22:35 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-02-10 18:22:35 +0100 |
commit | 7cbd8fd326339fc7dcc313ba5781534984c299c2 (patch) | |
tree | 4abcd10f034fe777494da838347a061423ef920d /storage.cpp | |
parent | eccdcf5b38eff88c00b2ea77d2abe1924b2ff349 (diff) |
Document SQLite handling VARCHAR size
Diffstat (limited to 'storage.cpp')
-rw-r--r-- | storage.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/storage.cpp b/storage.cpp index f7b8b5d..c5caa79 100644 --- a/storage.cpp +++ b/storage.cpp @@ -14,6 +14,7 @@ Storage::Storage(const Config& config): m_db(config.getDataPath() + "/whiteboard.db3", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE), m_maxage(config.getMaxage()), + // Note about VARCHAR(N): "SQLite does not impose any length restrictions" m_stmt_create(m_db, "CREATE TABLE IF NOT EXISTS documents (id VARCHAR(16) PRIMARY KEY, value BLOB, rev INTEGER, cursorpos INTEGER, timestamp BIGINT)"), m_stmt_getNumberOfDocuments(m_db, "SELECT COUNT(*) FROM documents"), m_stmt_cleanup(m_db, "DELETE FROM documents WHERE timestamp + ? < ?"), |