Page MenuHomeDevCentral

Store log entries in a SQLite database
ClosedPublic

Authored by dereckson on Nov 11 2016, 17:08.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 14:51
Unknown Object (File)
Thu, Nov 21, 14:51
Unknown Object (File)
Mon, Nov 18, 01:02
Unknown Object (File)
Sat, Nov 9, 17:17
Unknown Object (File)
Oct 23 2024, 05:32
Unknown Object (File)
Oct 21 2024, 08:46
Unknown Object (File)
Oct 20 2024, 05:26
Unknown Object (File)
Oct 18 2024, 10:05
Subscribers
None

Details

Summary

As we open a connection at service start, and the broker
will submit one per one entries, we can use a SQLite database.

Test Plan

Tests are provided to open, destroy a datastore, insert an entry.

They create and delete correctly the SQLite database file.

When we run insert_adds_a_row test, without a call to store.destroy():

$ sqlite3 log.db
SQLite version 3.15.1 2016-11-04 12:08:49
Enter ".help" for usage hints.
sqlite> .tables
log
sqlite> SELECT * FROM log;
2016-03-30T13:03:00Z|Sandlayth|#nasqueron-ops|Dwellers|docker start wolfphab

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Branch
store
Build Status
Buildable 1071
Build 1286: arc lint + arc unit

Event Timeline

dereckson retitled this revision from to WIP: SQLite3 store.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
src/store.rs
37

Document it's from environment or a default value.

Update test name to avoid to run both of them from prefix.

Prepared statement, insert, tests for create/destroy

Return numbers of rows updated, tests insert, lifetimes, tests names

dereckson retitled this revision from WIP: SQLite3 store to Store log entries in a SQLite database.Nov 14 2016, 23:07
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson marked an inline comment as done.
dereckson edited edge metadata.

Last tweaks

dereckson edited edge metadata.
This revision is now accepted and ready to land.Nov 15 2016, 02:34
This revision was automatically updated to reflect the committed changes.