|
Player12
An open source football management simulator
|
Classes | |
| struct | Change |
| struct | Column |
| class | Error |
| class | Extensions |
| struct | Page |
| class | Payloads |
| struct | Relation |
| struct | Row |
| struct | Table |
Typedefs | |
| using | Blob = std::vector< unsigned char > |
| using | Value = std::variant< std::monostate, std::int64_t, double, std::string, Blob > |
| using | Validator = std::function< void(sqlite3 *, const std::vector< Change > &)> |
Enumerations | |
| enum class | Operation { Update , Insert , Delete } |
Functions | |
| std::string | quote (const std::string &identifier) |
| std::string | schema (sqlite3 *db) |
| std::vector< Table > | catalog (sqlite3 *db) |
| int | schemaVersion (sqlite3 *db) |
| Page | read (sqlite3 *db, const std::string &name, int offset, const std::string &search, int limit, const std::map< std::string, Value, std::less<> > &filter) |
| void | apply (sqlite3 *db, const std::vector< Change > &changes, const std::vector< Validator > &validators, bool defer_relations) |
| void | copy (sqlite3 *source, sqlite3 *destination) |
| int | storageType (const Value &item) |
| std::string | display (const Value &item) |
| Value | parse (int type, const std::string &input) |
Schema-driven data editing. No football schema or SQL supplied by the UI. The caller owns the connection and serializes access. SQLite constraints and registered validators run in the same savepoint as the mutations.
| using RuntimeEditor::Blob = typedef std::vector<unsigned char> |
| using RuntimeEditor::Validator = typedef std::function<void(sqlite3*, const std::vector<Change>&)> |
| using RuntimeEditor::Value = typedef std::variant<std::monostate, std::int64_t, double, std::string, Blob> |
|
strong |
| void RuntimeEditor::apply | ( | sqlite3 * | db, |
| const std::vector< Change > & | changes, | ||
| const std::vector< Validator > & | validators = {}, |
||
| bool | defer_relations = false |
||
| ) |
Throws on stale schema/record, invalid types, constraints or validation. All changes roll back together. Existing legacy FK violations may remain; newly introduced violations are rejected.
| std::vector< Table > RuntimeEditor::catalog | ( | sqlite3 * | db | ) |
| void RuntimeEditor::copy | ( | sqlite3 * | source, |
| sqlite3 * | destination | ||
| ) |
| std::string RuntimeEditor::display | ( | const Value & | item | ) |
| Value RuntimeEditor::parse | ( | int | type, |
| const std::string & | input | ||
| ) |
| std::string RuntimeEditor::quote | ( | const std::string & | identifier | ) |
| Page RuntimeEditor::read | ( | sqlite3 * | db, |
| const std::string & | name, | ||
| int | offset, | ||
| const std::string & | search, | ||
| int | limit, | ||
| const std::map< std::string, Value, std::less<> > & | filter | ||
| ) |
| std::string RuntimeEditor::schema | ( | sqlite3 * | db | ) |
| int RuntimeEditor::schemaVersion | ( | sqlite3 * | db | ) |
| int RuntimeEditor::storageType | ( | const Value & | item | ) |