Player12
An open source football management simulator
Loading...
Searching...
No Matches
SqliteRows Namespace Reference

Functions

template<typename T >
T column (sqlite3_stmt *stmt, int index)
 
float columnFloat (sqlite3_stmt *stmt, int index)
 
std::string columnText (sqlite3_stmt *stmt, int index)
 
void bindText (sqlite3_stmt *stmt, int index, const std::string &text)
 
template<typename Read >
void forEach (const DatabaseConnection &db, const char *sql, Read read)
 
template<typename Range , typename Bind >
void insertAll (const DatabaseConnection &db, const char *sql, const Range &items, Bind bind)
 
void clearTable (const DatabaseConnection &db, const char *table)
 

Detailed Description

Small helpers for the state tables that are rewritten on every save (DELETE + INSERT inside the caller's transaction).

Function Documentation

◆ bindText()

void SqliteRows::bindText ( sqlite3_stmt *  stmt,
int  index,
const std::string &  text 
)
inline

◆ clearTable()

void SqliteRows::clearTable ( const DatabaseConnection &  db,
const char *  table 
)
inline

Empties a table owned by the caller.

◆ column()

template<typename T >
T SqliteRows::column ( sqlite3_stmt *  stmt,
int  index 
)

◆ columnFloat()

float SqliteRows::columnFloat ( sqlite3_stmt *  stmt,
int  index 
)
inline

◆ columnText()

std::string SqliteRows::columnText ( sqlite3_stmt *  stmt,
int  index 
)
inline

◆ forEach()

template<typename Read >
void SqliteRows::forEach ( const DatabaseConnection &  db,
const char *  sql,
Read  read 
)

Runs read for every row of sql.

◆ insertAll()

template<typename Range , typename Bind >
void SqliteRows::insertAll ( const DatabaseConnection &  db,
const char *  sql,
const Range &  items,
Bind  bind 
)

Inserts every item of items with one prepared statement.