nanodbc
A small C++ wrapper for the native C ODBC API
Loading...
Searching...
No Matches
nanodbc Namespace Reference

The entirety of nanodbc can be found within this one namespace. More...

Classes

class  attribute
 A class representing a connection or a statement attribute. More...
 
struct  batch_ops
 A type capturing parameter array length as well as number of rows in a rowset of a result. More...
 
class  catalog
 A resource for get catalog information from connected data source. More...
 
class  connection
 Manages and encapsulates ODBC resources such as the connection and environment handles. More...
 
class  database_error
 General database error. More...
 
struct  datasource
 A data source name registered with the driver manager. More...
 
struct  date
 A type for representing date data. More...
 
struct  driver
 Information on a configured ODBC driver. More...
 
class  implementation_row_descriptor
 Provides access to metadata in the Implementation Row Descriptor (IRD) implicitly allocated for a prepared or executed statement. More...
 
class  index_range_error
 Index out of range. More...
 
class  null_access_error
 Accessed null data. More...
 
class  programming_error
 Programming logic error. More...
 
class  result
 A resource for managing result sets from statement execution. More...
 
class  result_iterator
 Single pass input iterator that accesses successive rows in the attached result set. More...
 
class  statement
 Represents a statement on the database. More...
 
class  table_valued_parameter
 Support for table-valued parameter. More...
 
struct  time
 A type for representing time data. More...
 
struct  timestamp
 A type for representing timestamp data. More...
 
struct  timestampoffset
 A type for representing timestamp+offset data. More...
 
class  transaction
 A resource for managing transaction commits and rollbacks. More...
 
class  type_incompatible_error
 Type incompatible. More...
 

Typedefs

typedef unspecified type string
 string will be std::u16string or std::32string if NANODBC_ENABLE_UNICODE defined.
 
typedef unspecified type null_type
 null_type will be int64_t for 64-bit compilations, otherwise long.
 
template<typename T >
using is_string = std::integral_constant< bool, std::is_same< typename std::decay< T >::type, std::string >::value||std::is_same< typename std::decay< T >::type, wide_string >::value >
 A type trait for testing if a type is a std::basic_string compatible with the current nanodbc configuration.
 
template<typename T >
using is_character = std::integral_constant< bool, std::is_same< typename std::decay< T >::type, std::string::value_type >::value||std::is_same< typename std::decay< T >::type, wide_char_t >::value >
 A type trait for testing if a type is a character compatible with the current nanodbc configuration.
 
template<typename T >
using enable_if_string = typename std::enable_if< is_string< T >::value >::type
 Enables an overload only for the string types nanodbc binds as strings.
 
template<typename T >
using enable_if_character = typename std::enable_if< is_character< T >::value >::type
 Enables an overload only for the character types nanodbc binds as strings.
 

Functions

result_iterator begin (result &r)
 Returns an iterator to the beginning of the given result set.
 
result_iterator end (result &) noexcept
 Returns an iterator to the end of a result set.
 
std::list< driverlist_drivers ()
 Returns a list of ODBC drivers on your system.
 
std::list< datasourcelist_datasources ()
 Returns a list of ODBC data sources on your system.
 
result execute (connection &conn, string const &query, long batch_operations=1, long timeout=0)
 Immediately opens, prepares, and executes the given query directly on the given connection.
 
void just_execute (connection &conn, string const &query, long batch_operations=1, long timeout=0)
 Opens, prepares, and executes query directly without creating result object.
 
result execute (statement &stmt, long batch_operations=1)
 Execute the previously prepared query now.
 
void just_execute (statement &stmt, long batch_operations=1)
 Execute the previously prepared query now and without creating result object.
 
result transact (statement &stmt, long batch_operations)
 Execute the previously prepared query now.
 
void just_transact (statement &stmt, long batch_operations)
 Execute the previously prepared query now and without creating result object.
 
void prepare (statement &stmt, string const &query, long timeout=0)
 Prepares the given statement to execute on it associated connection.
 

Detailed Description

The entirety of nanodbc can be found within this one namespace.

Note
This library does not make any exception safety guarantees, but should work just fine with a threading enabled ODBC driver. If you want to use nanodbc objects in threads I recommend each thread keep their own connection to the database. Otherwise you must synchronize any access to nanodbc objects.

Typedef Documentation

◆ string

typedef unspecified type nanodbc::string

string will be std::u16string or std::32string if NANODBC_ENABLE_UNICODE defined.

Otherwise it will be std::string.