Classes | |
class | sptk::AutoDatabaseConnection |
class | sptk::DatabaseConnectionParameters |
Database connection parameters. More... | |
struct | sptk::DatabaseDriver |
class | sptk::DatabaseConnectionPool |
class | sptk::DatabaseConnectionString |
class | sptk::DatabaseField |
database field More... | |
class | sptk::InsertQuery |
struct | sptk::QueryColumnTypeSize |
class | sptk::PoolDatabaseConnectionQueryMethods |
class | sptk::PoolDatabaseConnection |
class | sptk::QueryStatementManagement |
class | sptk::Query |
class | sptk::QueryParameterBinding |
class | sptk::QueryParameterList |
class | sptk::Transaction |
Database Transaction. More... | |
Typedefs | |
using | sptk::DatabaseConnection = std::shared_ptr< AutoDatabaseConnection > |
using | sptk::CreateDriverInstance = PoolDatabaseConnection *(const char *connectString, size_t connectTimeoutSeconds) |
using | sptk::DestroyDriverInstance = void(PoolDatabaseConnection *) |
using | sptk::DriverHandle = uint8_t * |
using | sptk::SDatabaseConnectionString = std::shared_ptr< DatabaseConnectionString > |
using | sptk::SDatabaseField = std::shared_ptr< DatabaseField > |
using | sptk::DBHandle = uint8_t * |
using | sptk::StmtHandle = uint8_t * |
using | sptk::SStmtHandle = std::shared_ptr< uint8_t > |
using | sptk::QueryColumnTypeSizeVector = std::vector< QueryColumnTypeSize > |
using | sptk::QueryColumnTypeSizeMap = std::map< std::string, QueryColumnTypeSize, std::less<> > |
using | sptk::SPoolDatabaseConnection = std::shared_ptr< PoolDatabaseConnection > |
using | sptk::SQuery = std::shared_ptr< Query > |
using | sptk::CParamVector = std::vector< SQueryParameter > |
Enumerations | |
enum class | sptk::DatabaseConnectionType : uint16_t { DatabaseConnectionType::UNKNOWN = 0 , DatabaseConnectionType::MYSQL = 1 , DatabaseConnectionType::ORACLE = 2 , DatabaseConnectionType::POSTGRES = 4 , DatabaseConnectionType::SQLITE3 = 8 , DatabaseConnectionType::FIREBIRD = 16 , DatabaseConnectionType::GENERIC_ODBC = 32 , DatabaseConnectionType::MSSQL_ODBC = 64 } |
enum class | sptk::DatabaseObjectType : uint8_t { DatabaseObjectType::UNDEFINED , DatabaseObjectType::TABLES , DatabaseObjectType::VIEWS , DatabaseObjectType::PROCEDURES , DatabaseObjectType::FUNCTIONS , DatabaseObjectType::DATABASES } |
Functions | |
sptk::InsertQuery::InsertQuery (const DatabaseConnection &db, const String &sql="", const String &idFieldName="id") | |
String | sptk::InsertQuery::sql () const override |
void | sptk::InsertQuery::sql (const String &_sql) override |
void | sptk::InsertQuery::exec () override |
void | sptk::InsertQuery::exec (const String &newSQL) override |
uint64_t | sptk::InsertQuery::id () const |
SP_EXPORT String | sptk::escapeSQLString (const String &str, bool tsv=false) |
SPTK_OracleConnection
using sptk::CParamVector = typedef std::vector<SQueryParameter> |
A vector of CParam*
Doesn't mantain CParam memory. Used to return a list of pointers on existing parameters.
using sptk::CreateDriverInstance = typedef PoolDatabaseConnection*(const char* connectString, size_t connectTimeoutSeconds) |
Create driver instance function type
using sptk::DestroyDriverInstance = typedef void(PoolDatabaseConnection*) |
Destroy driver instance function type
using sptk::DriverHandle = typedef uint8_t* |
Unix: Driver shared library handle type
using sptk::QueryColumnTypeSizeMap = typedef std::map<std::string, QueryColumnTypeSize, std::less<> > |
Map of column names to column type and size structures
using sptk::QueryColumnTypeSizeVector = typedef std::vector<QueryColumnTypeSize> |
Vector of column type and size structures
|
strong |
|
strong |
Escape SQL string for bulk insert
str | String to escape |
tsv | True if output data is TSV (tab-separated values) |
|
overridevirtual |
Executes insert query.
Retrieves value of "id" field and sets internal value for id().
Reimplemented from sptk::Query.
|
inlineoverridevirtual |
Executes the query and closes the statement.
Query SQL would be set to the new SQL statement
newSQL | SQL statement to execute |
Reimplemented from sptk::Query.
|
inline |
Get created record id
|
explicit |
Constructor
You can optionally provide the name of the file and line number where this query is created. This is used to collect statistical information for the query calls. If file and line information is provided, then calls statistics is stored to the database object during the query dtor.
db | Database connection |
sql | SQL query, optional |
idFieldName | Name of auto-incremental field |
|
overridevirtual |
|
overridevirtual |
Sets SQL Query text. If the Query text is not the same and the db statement was prepared earlier then the db statement is released and new one is created.
_sql | Query SQL |
Reimplemented from sptk::Query.