View on GitHub API Documentation
A small C++ wrapper for the native C ODBC API.
Classes | Typedefs | Functions
nanodbc Namespace Reference

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

Classes

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  date
 A type for representing date data. More...
 
struct  driver
 Information on a configured ODBC driver. 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...
 
struct  time
 A type for representing time data. More...
 
struct  timestamp
 A type for representing timestamp 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
 
typedef unspecified type null_type
 null_type will be int64_t for 64-bit compilations, otherwise long.
 

Functions

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

Detailed Description

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.