Record committed best-bid and ask changes for resumable quote history
This commit is contained in:
@@ -17,6 +17,7 @@ mod market;
|
||||
mod neg_risk;
|
||||
mod portfolio;
|
||||
mod prices_history;
|
||||
mod quotes;
|
||||
mod resident;
|
||||
mod resolution;
|
||||
use resident::Books;
|
||||
@@ -43,6 +44,14 @@ impl Exchange {
|
||||
if !activity_ready {
|
||||
db.execute_batch(include_str!("activity_schema.sql"))?;
|
||||
}
|
||||
let quotes_ready: bool = db.query_row(
|
||||
"SELECT EXISTS(SELECT 1 FROM sqlite_schema WHERE type='table' AND name='quote_events')",
|
||||
[],
|
||||
|row| row.get(0),
|
||||
)?;
|
||||
if !quotes_ready {
|
||||
db.execute_batch(include_str!("quote_schema.sql"))?;
|
||||
}
|
||||
let tx = expiry::transaction(&db, TransactionBehavior::Deferred)?;
|
||||
let books = Books::recover(&tx)?;
|
||||
tx.commit()?;
|
||||
@@ -60,6 +69,7 @@ impl Exchange {
|
||||
| "history"
|
||||
| "prices_history"
|
||||
| "quote"
|
||||
| "quote_history"
|
||||
| "book"
|
||||
| "open_orders"
|
||||
| "positions"
|
||||
|
||||
Reference in New Issue
Block a user