Page MenuHomeDevCentral

WIP: Allow HTTP server to consume SQLite
Changes PlannedPublic

Authored by dereckson on Nov 15 2016, 05:27.
Tags
None
Referenced Files
F3156437: D712.id1792.diff
Tue, Jun 25, 17:43
Unknown Object (File)
Mon, Jun 24, 02:46
Unknown Object (File)
Mon, Jun 24, 01:35
Unknown Object (File)
Mon, Jun 24, 00:22
Unknown Object (File)
Sun, Jun 23, 21:04
Unknown Object (File)
Sat, Jun 22, 21:21
Unknown Object (File)
Fri, Jun 21, 14:53
Unknown Object (File)
Fri, Jun 21, 12:09
Subscribers
None

Details

Reviewers
dereckson
Summary

We switch to rusqlite, as it's the driver implemented by r2d2,
a pool of database connections.

This change is based on the following example and tests:

Test Plan

Implement ::web_handlers::get to serve SELECT * FROM Log

Diff Detail

Repository
rSERVERSLOG Servers log microservice
Lint
No Lint Coverage
Unit
No Test Coverage
Branch
store (branched from master)
Build Status
Buildable 1112
Build 1327: arc lint + arc unit

Event Timeline

dereckson retitled this revision from to WIP: Allow HTTP server to consume SQLite.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.

Next step is to allow to initialize instances of DataStore with a connection from the pool.

We also need to move the init code to populate schema to run only once at program start.

dereckson edited edge metadata.

Switch to r2d2 and rusqlite, prepare a pool, clean not used stored methods. SQLite-related tests currently disabled.

src/main.rs
15–18

Our code doesn't seem to use lazy_static!

src/store.rs
153

from Log

src/web_handlers.rs
18

Gets a data store, with a connection from the pool.

dereckson marked 2 inline comments as done.

Code r2d2 compatible

dereckson added inline comments.
src/store.rs
46

Too many.

Decrease both here and in Iron to 2-4.