Page MenuHomeDevCentral

Store log entries in a SQLite database
ClosedPublic

Authored by dereckson on Nov 11 2016, 17:08.
Tags
None
Referenced Files
F7685028: D704.diff
Thu, May 1, 00:54
F7638005: D704.id.diff
Wed, Apr 30, 04:32
F7634092: D704.id1785.diff
Wed, Apr 30, 03:03
Unknown Object (File)
Tue, Apr 29, 11:56
Unknown Object (File)
Mon, Apr 28, 06:50
Unknown Object (File)
Sun, Apr 27, 07:13
Unknown Object (File)
Fri, Apr 25, 17:13
Unknown Object (File)
Wed, Apr 23, 23:06
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 1080
Build 1295: 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.