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)
Sun, Nov 24, 16:09
Unknown Object (File)
Sat, Nov 23, 14:38
Unknown Object (File)
Sat, Nov 23, 02:33
Unknown Object (File)
Fri, Nov 22, 23:25
Unknown Object (File)
Fri, Nov 22, 23:21
Unknown Object (File)
Fri, Nov 22, 23:11
Unknown Object (File)
Fri, Nov 22, 23:09
Unknown Object (File)
Fri, Nov 22, 23:00
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 1079
Build 1294: 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
38

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.