Page MenuHomeDevCentral

WIP: Allow HTTP server to consume SQLite
Changes PlannedPublic

Authored by dereckson on Nov 15 2016, 05:27.
Tags
None
Referenced Files
F3762774: D712.diff
Thu, Nov 21, 14:51
Unknown Object (File)
Sat, Nov 9, 23:44
Unknown Object (File)
Sat, Nov 9, 23:44
Unknown Object (File)
Thu, Nov 7, 21:34
Unknown Object (File)
Mon, Nov 4, 18:37
Unknown Object (File)
Oct 22 2024, 09:32
Unknown Object (File)
Oct 21 2024, 01:15
Unknown Object (File)
Oct 16 2024, 23:07
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 1084
Build 1299: 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
95

from Log

src/web_handlers.rs
18 ↗(On Diff #1835)

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
42

Too many.

Decrease both here and in Iron to 2-4.