FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
sqlite_store.hpp
Go to the documentation of this file.
1#pragma once
2// The SQLite storage backend ([storage] backend = "sqlite"), the one FastMM ships.
3//
4// One file, WAL, one row per fill, order, position snapshot and kill event, plus a per-day PnL
5// roll-up kept as records arrive. The schema and the durability it gives are in
6// docs/reference/storage.md; the SQL itself is src/store/sqlite_schema.cpp.
7//
8// SQLite is bundled (cmake/Dependencies.cmake pins the amalgamation) rather than taken from the
9// host: FastMM vendors its dependencies through CPM (ADR-0005), the WAL and UPSERT behaviour the
10// store relies on is version-dependent, and a trading host should not need a -dev package.
13
14#include <memory>
15
16namespace fastmm::store {
17
18// Bumped whenever the schema changes; sqlite_schema.cpp holds one migration step per version.
19inline constexpr int kSqliteSchemaVersion = 9;
20
21[[nodiscard]] std::unique_ptr<Backend> make_sqlite_backend();
22[[nodiscard]] std::unique_ptr<Reader> make_sqlite_reader();
24// Where the backend puts its file: [storage] path, else "<default_dir>/<engine_name>.db".
25[[nodiscard]] std::string sqlite_path(const BackendOptions& opts);
26
27} // namespace fastmm::store
Storage backend interface: what a session's fills, orders, positions, PnL and kill events are handed ...
Definition backend.hpp:39
constexpr int kSqliteSchemaVersion
Bumped whenever the schema changes; sqlite_schema.cpp holds one migration step per version.
Definition sqlite_store.hpp:21
std::unique_ptr< Backend > make_sqlite_backend()
std::string sqlite_path(const BackendOptions &opts)
Where the backend puts its file: [storage] path, else "<default_dir>/<engine_name>....
std::unique_ptr< Reader > make_sqlite_reader()
Query side of a storage backend: what fastmm-pnl and a restarting session read back.
What a backend is built with.
Definition backend.hpp:43