|
Public Member Functions |
virtual | ~dbserver () |
| destructor
|
virtual size_t | get_ident () const =0 |
| returns current ident to distingush different instances of dbserver
|
virtual bool | is_ready () const =0 |
| returns current state to check if the sql asynchronous action completed.
|
virtual size_t | get_code () const =0 |
| returns error code
|
virtual const char * | get_error () const =0 |
| returns error description, NULL will be returned if there are no errors
|
virtual bool | connect (bool trusted_connection, const char *connect_string)=0 |
| db connection methods
|
virtual bool | disconnect ()=0 |
| closes connection
|
virtual bool | start_transaction ()=0 |
| starts transaction
|
virtual bool | commit ()=0 |
| commits transaction
|
virtual bool | rollback ()=0 |
| rolls back transaction
|
virtual bool | is_connect () const =0 |
| returns the connection status
|
virtual bool | is_in_transaction () const =0 |
| returns the transaction status
|
virtual bool | is_connect_alive ()=0 |
| checks if the connection is alive or not
|
virtual bool | resize_params (size_t size)=0 |
| sql methods
|
virtual size_t | get_param_count () const =0 |
| gets param count
|
virtual dbtypes | get_param_type (size_t index) const =0 |
| returns the virtual terimber type like db_bool, ...
|
virtual db_param_type | get_param_in_out (size_t index) const =0 |
| returns the in/out
|
virtual bool | get_param_is_null (size_t index) const =0 |
| returns the nullable - database specific
|
virtual bool | get_param_as_bool (size_t index) const =0 |
| returns param value
|
virtual sb1_t | get_param_as_char (size_t index) const =0 |
| get parameter as char conversion can be made
|
virtual ub1_t | get_param_as_byte (size_t index) const =0 |
| gets the parameter as a byte conversion can be made
|
virtual sb2_t | get_param_as_short (size_t index) const =0 |
| gets the parameter as a short conversion can be made
|
virtual ub2_t | get_param_as_word (size_t index) const =0 |
| gets the parameter as an unsigned short conversion can be made
|
virtual sb4_t | get_param_as_long (size_t index) const =0 |
| gets the parameter as a long int (4 bytes) conversion can be made
|
virtual ub4_t | get_param_as_dword (size_t index) const =0 |
| gets the parameter as an unsigned long int (4 bytes) conversion can be made
|
virtual float | get_param_as_float (size_t index) const =0 |
| gets the parameter as a float (4 bytes) conversion can be made
|
virtual double | get_param_as_double (size_t index) const =0 |
| gets the parameter as a double (8 bytes) conversion can be made
|
virtual sb8_t | get_param_as_long64 (size_t index) const =0 |
| gets the parameter as a signed long long (8 bytes) conversion can be made
|
virtual ub8_t | get_param_as_dword64 (size_t index) const =0 |
| gets the parameter as an unsigned long long (8 bytes) conversion can be made
|
virtual bool | get_param_as_guid (size_t index, guid_t &val) const =0 |
| gets the parameter as a guid conversion can be made for high performance we are using reference
|
virtual const char * | get_param_as_numeric (size_t index, char delimeter) const =0 |
| gets the parameter as a word conversion can be made delimeter defines the desirable delimeter sign
|
virtual const char * | get_param_as_decimal (size_t index, char delimeter) const =0 |
| gets the parameter as a word conversion can be made delimeter defines the desirable delimeter sign
|
virtual bool | get_param_as_date (size_t index, ub4_t &year, ub1_t &month, ub1_t &day, ub1_t &hour, ub1_t &minute, ub1_t &second, ub2_t &millisec, ub1_t &wday, ub2_t &yday) const =0 |
| gets the parameter as a word conversion can be made to avoid confusions with different date format functions returns parsed date
|
virtual const char * | get_param_as_string (size_t index) const =0 |
| gets the parameter as a word conversion can be made function returns the pointer to the string
|
virtual const wchar_t * | get_param_as_wstring (size_t index) const =0 |
| gets the parameter as a word conversion can be made function returns the pointer to the wide string
|
virtual const ub1_t * | get_param_as_binary (size_t index, size_t &len) const =0 |
| function returns the pointer to byte array len will contain the length of byte array
|
virtual const ub1_t * | get_param_as_binary_ptr (size_t index) const =0 |
| the format of buffer is as follows first size_t bytes the length of the rest of buffer, which contains the raw byte data
|
virtual bool | set_param_as_null (size_t index, db_param_type in_out, dbtypes type)=0 |
| sets the parameter as null
|
virtual bool | set_param_as_bool (size_t index, db_param_type in_out, bool val)=0 |
| sets the parameter as a bool
|
virtual bool | set_param_as_char (size_t index, db_param_type in_out, sb1_t val)=0 |
| sets the parameter as a char
|
virtual bool | set_param_as_byte (size_t index, db_param_type in_out, ub1_t val)=0 |
| sets the parameter as a byte
|
virtual bool | set_param_as_short (size_t index, db_param_type in_out, sb2_t val)=0 |
| sets the parameter as a signed short (2 bytes)
|
virtual bool | set_param_as_word (size_t index, db_param_type in_out, ub2_t val)=0 |
| sets the parameter as an unsigned short (2 bytes)
|
virtual bool | set_param_as_long (size_t index, db_param_type in_out, sb4_t val)=0 |
| sets the parameter as a long int (4 bytes)
|
virtual bool | set_param_as_dword (size_t index, db_param_type in_out, ub4_t val)=0 |
| sets the parameter as an unsigned long int (4 bytes)
|
virtual bool | set_param_as_float (size_t index, db_param_type in_out, float val)=0 |
| sets the parameter as a float (4 bytes)
|
virtual bool | set_param_as_double (size_t index, db_param_type in_out, double val)=0 |
| sets the parameter as a double (8 bytes)
|
virtual bool | set_param_as_long64 (size_t index, db_param_type in_out, sb8_t val)=0 |
| sets the parameter as a long long int (8 bytes)
|
virtual bool | set_param_as_dword64 (size_t index, db_param_type in_out, ub8_t val)=0 |
| sets the parameter as an unsigned long long int (8 bytes)
|
virtual bool | set_param_as_guid (size_t index, db_param_type in_out, const guid_t &val)=0 |
| sets the parameter as a guid
|
virtual bool | set_param_as_numeric (size_t index, db_param_type in_out, const char *val, char delimeter)=0 |
| sets the parameter as numeric
|
virtual bool | set_param_as_decimal (size_t index, db_param_type in_out, const char *val, char delimeter)=0 |
| sets the parameter as a decimal
|
virtual bool | set_param_as_date (size_t index, db_param_type in_out, ub4_t year, ub1_t month, ub1_t day, ub1_t hour, ub1_t minute, ub1_t second, ub2_t millisec)=0 |
| sets the parameter as a date
|
virtual bool | set_param_as_string (size_t index, db_param_type in_out, const char *val, size_t len, size_t max_len=0)=0 |
| sets the parameter as a string for 0 terminated string len can be -1 max_len for output parameter only
|
virtual bool | set_param_as_string_ptr (size_t index, const char *val)=0 |
| sets the parameter as a string pointer to avoid copying already allocated memory, only the pointer can be used be careful! the caller is responsible for the life time of the provided pointer, which has to be valid until the sql statement has been executed. it supposed that it will work only for the input parameters, not for output or input/output ones
|
virtual bool | set_param_as_wstring (size_t index, db_param_type in_out, const wchar_t *val, size_t len, size_t max_len=0)=0 |
| sets the parameter as a wide string for 0 terminated string len can be -1 max_len for output parameter only
|
virtual bool | set_param_as_wstring_ptr (size_t index, const wchar_t *val)=0 |
| sets the parameter as a wide string pointer to avoid copying the already allocated huge memory, only the pointer can be used be careful! the caller is responsible for the life time of provided pointer, which has to be valid until the sql statement is been executing. it is supposed to work only for input parameters, not for output or input/output ones
|
virtual bool | set_param_as_binary (size_t index, db_param_type in_out, const ub1_t *val, size_t len, size_t max_len=0)=0 |
| sets the parameter as a wide string pointer val points to the valid buffer of raw byte of "len" length max_len for output parameter only
|
virtual bool | set_param_as_binary_ptr (size_t index, const ub1_t *val)=0 |
| sets the parameter as a wide string pointer to avoid copying the already allocated huge memory, only the pointer can be used be careful! the caller is responsible for the life time of the provided pointer, which has to be valid until the sql statement is been executing. the format of buffer must be as follow first size_t bytes the length of the rest of buffer, which contains the raw byte data it is supposed to only work for input parameters, not for output or input/output ones
|
virtual size_t | get_column_count () const =0 |
| internal columns access
|
virtual dbtypes | get_column_type (size_t index) const =0 |
| returns the virtual terimber dbtype like db_bool, ...
|
virtual const char * | get_column_name (size_t index) const =0 |
| returns the name of the column
|
virtual bool | get_column_nullable (size_t index) const =0 |
| returns the nullable - database specific
|
virtual size_t | get_column_scale (size_t index) const =0 |
| returns the scale
|
virtual size_t | get_column_precision (size_t index) const =0 |
| returns the precision
|
virtual size_t | get_column_max_length (size_t index) const =0 |
| returns the length of column (only for fixed length columns)
|
virtual size_t | get_row_count () const =0 |
| rowset navigation methods
|
virtual void | reset () const =0 |
| resets the internal cursor to the out of end
|
virtual bool | next () const =0 |
| tries to find the next row, after reset it goes to the first row
|
virtual bool | prev () const =0 |
| tries to find the previous row, after reset it goes to the last row
|
virtual bool | get_value_is_null (size_t index) const =0 |
| returns the value of the column at the current row position
|
virtual bool | get_value_as_bool (size_t index) const =0 |
| gets the value as a boolean
|
virtual sb1_t | get_value_as_char (size_t index) const =0 |
| gets the value as a char
|
virtual ub1_t | get_value_as_byte (size_t index) const =0 |
| gets the value as a byte
|
virtual sb2_t | get_value_as_short (size_t index) const =0 |
| gets the value as a short int (2 bytes)
|
virtual ub2_t | get_value_as_word (size_t index) const =0 |
| gets the value as an unsigned short int (2 bytes)
|
virtual sb4_t | get_value_as_long (size_t index) const =0 |
| gets the value as a long int (4 bytes)
|
virtual ub4_t | get_value_as_dword (size_t index) const =0 |
| gets the value as an unsigned long int (4 bytes)
|
virtual float | get_value_as_float (size_t index) const =0 |
| gets the value as a float (4 bytes)
|
virtual double | get_value_as_double (size_t index) const =0 |
| gets the value as a double (8 bytes)
|
virtual sb8_t | get_value_as_long64 (size_t index) const =0 |
| gets the value as a long long int (8 bytes)
|
virtual ub8_t | get_value_as_dword64 (size_t index) const =0 |
| gets the value as an unsigned long long int (8 bytes)
|
virtual bool | get_value_as_guid (size_t index, guid_t &val) const =0 |
| gets the value as a guid
|
virtual const char * | get_value_as_numeric (size_t index, char delimeter) const =0 |
| gets the value as a guid delimeter defines the desirable delimeter sign
|
virtual const char * | get_value_as_decimal (size_t index, char delimeter) const =0 |
| gets the value as a guid delimeter defines the desirable delimeter sign
|
virtual bool | get_value_as_date (size_t index, ub4_t &year, ub1_t &month, ub1_t &day, ub1_t &hour, ub1_t &minute, ub1_t &second, ub2_t &millisec, ub1_t &wday, ub2_t &yday) const =0 |
| gets the value as a date to avoid confusions with different date format the functions return parsed date
|
virtual const char * | get_value_as_string (size_t index) const =0 |
| gets the value as a date function returns the pointer to string
|
virtual const wchar_t * | get_value_as_wstring (size_t index) const =0 |
| function returns the pointer to wide string
|
virtual const ub1_t * | get_value_as_binary (size_t index, size_t &len) const =0 |
| returns pointer to the raw bytes size of bytes is put to len
|
virtual const ub1_t * | get_value_as_binary_ptr (size_t index) const =0 |
| returns pointer to the raw bytes for reusing only the format of buffer is as follow first size_t bytes the length of the rest of buffer, which contains the raw byte data
|
virtual bool | is_open_sql () const =0 |
| checks the state of the sql request
|
virtual bool | open_sql (bool async, const char *sql)=0 |
| executes the parameterized sql statement with recordset result
|
virtual bool | exec_sql (bool async, const char *sql)=0 |
| executes the parameterized sql statement without recordset result
|
virtual bool | open_proc (bool async, const char *name)=0 |
| executes the stored procedure with recordset result
|
virtual bool | exec_proc (bool async, const char *name)=0 |
| executes the stored procedure without recordset result
|
virtual bool | fetch_data (bool async, size_t start_row, size_t num_rows, bool forward)=0 |
| fetches the data and returns the recordset defines the start row, numbers rows and fetches direction if start_row is 0 then the fetch starts from the position after the last position fetched before if start_row > 0 then start_row is considered as absolute row number in recordset
|
virtual bool | close_sql ()=0 |
| closes sql - free allocated resources
|
virtual bool | interrupt_request ()=0 |
| interrupts asynchronous request
|
virtual bool | set_quote (char quote)=0 |
| sets quote the syntax of sql statement with parameters must be understandable for internal sql processor therefore it should look like selects * from the table where pk = :pk here ':' char is an identificator of parameter with name "pk" function set_quote allows to change this identificator to the preferable one ':' is a default identificator
|
virtual void | set_callback (async_db_notify *target)=0 |
| sets the callback function for asynchronous actions
|
virtual void | remove_callback (async_db_notify *target)=0 |
| remove the callback function for asynchronous actions
|
virtual bool | param_bulk_store ()=0 |
| bulk operation support caller should very careful with these functionality current set of parameters previously set by set_param_* functions will be moved to the bulk parameters list the current parameters set will have the same values, but will not participate in bulk operations moreover if the next call set_param_* function will change the type - all bulk parameters will be deleted.
|
virtual bool | param_bulk_remove ()=0 |
| removes the last stored bulk parameter
|
virtual bool | param_bulk_remove_all ()=0 |
| removes all stored bulk parameters
|