handle
Receives a borrowed result row during execute(). Positional mode calls the vector overload, and mapped mode calls the map overload; override the form selected by setMapped() and copy any values needed later.
Databases
Execute SQL over local Catalyst tables and deliver result rows to a delegate.
#include <mc/CSQL.h>The delegate is borrowed and must outlive the CSQL instance. Positional rows use cvec; setMapped(true) selects named cmap rows.
Use parameter vectors for data values. This is Catalyst’s local SQL interface; CDB connects to PostgreSQL.
class CSQLDelegateReceives a borrowed result row during execute(). Positional mode calls the vector overload, and mapped mode calls the map overload; override the form selected by setMapped() and copy any values needed later.
class CSQLCSQL(CSQLDelegate* delegate, const cstr& dbPath, bool create);
CSQL(const CSQL&) = delete;
Opens or creates a local database and its schema catalog. The delegate is borrowed and receives rows when queries execute.
~CSQL();
void setMapped(bool flag);
Selects map callbacks when true and positional vector callbacks when false.
Executes SQL and delivers result rows synchronously to the delegate. Parameterized statements accept ? or one-based $n placeholders; supplied values are bound as data.
Executes a batch insertion from a vector of row vectors. Values may be moved from data; do not rely on the input rows remaining intact afterwards.
Imports CSV text using the insertion statement. header = true treats the first row as a header rather than data.
Reads a CSV file and imports it using the insertion statement. header = true skips the first CSV row as a header.