9#ifndef SL3_SQLCOMMAND_HPP
10#define SL3_SQLCOMMAND_HPP
15#include <sl3/config.hpp>
16#include <sl3/dataset.hpp>
17#include <sl3/dbvalue.hpp>
18#include <sl3/rowcallback.hpp>
42 using Connection = std::shared_ptr<internal::Connection>;
44 Command (Connection connection,
const std::string& sql);
47 const std::string& sql,
233 Connection _connection;
252 template <
typename... VALS>
Class to access data of query results.
Definition: columns.hpp:38
A compiled SQL command.
Definition: command.hpp:40
const DbValues & getParameters() const
Parameters of command.
Dataset select()
Run the Command and get the result.
void execute(const DbValues ¶meters)
Execute the command.
void execute(RowCallback &cb, const DbValues ¶meters={})
Execute the command applying given callback.
const DbValue & getParameter(int idx) const
get Parameter at given index.
std::function< bool(Columns)> Callback
function object for handling a command result.
Definition: command.hpp:123
Dataset select(const DbValues ¶meters, const Types &types={})
Run the Command and get the result.
void execute(Callback cb, const DbValues ¶meters={})
Execute the command applying given callback.
DbValues & getParameters()
Parameters of command.
std::vector< std::string > getParameterNames() const
get a list of the parameter names
DbValue & getParameter(int idx)
get Parameter at given index.
void resetParameters(DbValues values)
Set new parameter values.
Command(Command &&)
Move constructor.
Dataset select(const Types &types, const DbValues ¶meters={})
Run the Command and get the result.
void execute()
Execute the command.
void setParameters(const DbValues &values)
Set parameter values.
represents a SQLite3 Database
Definition: database.hpp:43
A utility for processing the result queries.
Definition: dataset.hpp:48
This class models the duck typing sqlite uses. It supports int, real, text, blob and null values.
Definition: dbvalue.hpp:43
A row of DbValues.
Definition: dbvalues.hpp:30
Callback for SQL Select statements.
Definition: rowcallback.hpp:30
A Container holding sl3::Type values.
Definition: types.hpp:62
Namespace of libSL3.
Definition: columns.hpp:18
DbValues parameters(VALS &&... vals)
Syntax sugar to create command parameters.
Definition: command.hpp:254