Lightweight 0.20261105.1
Loading...
Searching...
No Matches
Lightweight::Driver::SqlDriver Concept Reference

A database driver the library can be built with. More...

#include <Concept.hpp>

Concept definition

template<typename D>
requires {
typename D::Statement;
typename D::Connection;
{ D::Id } -> std::convertible_to<SqlDriverId>;
{ D::Name } -> std::convertible_to<std::string_view>;
{ D::SupportsParameterArrays } -> std::convertible_to<bool>;
{ D::SupportsRowArrayFetch } -> std::convertible_to<bool>;
{ D::StatementsDieWithConnection } -> std::convertible_to<bool>;
{ D::TranscodesNarrowText } -> std::convertible_to<bool>;
{ D::HasCatalogFunctions } -> std::convertible_to<bool>;
} && SqlDriverHandleStruct<typename D::Statement> && SqlDriverHandleStruct<typename D::Connection>
&& SqlDriverStatementOperations<D> && SqlDriverConnectionOperations<D>
A database driver the library can be built with.
Definition Concept.hpp:316

Detailed Description

A database driver the library can be built with.

A driver names its statement and connection handle structs, its SqlDriverId, its display Name (as error messages show it) and its capabilities, and provides the SqlDriverStatementOperations and the SqlDriverConnectionOperations. The capabilities are compile-time constants:

  • SupportsParameterArrays: whether a statement can execute a whole column-major or row-wise parameter array in one call (native batch execution).
  • SupportsRowArrayFetch: whether a statement can fetch a block of rows into array-bound columns in one call (block fetch and transparent prefetch).
  • StatementsDieWithConnection: whether closing a connection destroys its statement handles, so that they must not be freed afterwards.
  • TranscodesNarrowText: whether the driver may pass narrow text through a client codepage, so that whether narrow text round-trips byte-exact depends on the backend (see SqlConnection::RoundTripsNarrowTextByteExact); a driver exchanging narrow text as UTF-8 says false.
  • HasCatalogFunctions: whether the driver reads a database's catalog with catalog functions of its own (ODBC's SQLTables, SQLColumns, ...); a driver without says false, and SqlSchema reads the catalog with the SQL of SqlQueryFormatter::CatalogQueries().

Definition at line 316 of file Concept.hpp.