--- parser3/src/sql/pa_sql_driver.h 2004/03/05 10:01:50 1.39 +++ parser3/src/sql/pa_sql_driver.h 2004/06/18 15:55:47 1.41 @@ -26,13 +26,17 @@ #ifndef PA_SQL_DRIVER_H #define PA_SQL_DRIVER_H -static const char * const IDENT_SQL_DRIVER_H="$Date: 2004/03/05 10:01:50 $"; +static const char * const IDENT_SQL_DRIVER_H="$Date: 2004/06/18 15:55:47 $"; #include #include #include -#define SQL_DRIVER_API_VERSION 0x0008 +/* + 1..8 not logged + 9 introducing placeholders +*/ +#define SQL_DRIVER_API_VERSION 9 #define SQL_DRIVER_CREATE create /* used in driver implementation */ #define SQL_DRIVER_CREATE_NAME "create" /* could not figure out how to # it :( */ @@ -113,6 +117,13 @@ public: class SQL_Driver { public: + struct Placeholder { + const char* name; + const char* value; + bool is_null; + bool were_updated; + }; + /** allocated using our allocator, @todo never freed */ @@ -128,13 +139,12 @@ public: /// initialize driver by loading sql dynamic link library virtual const char* initialize(char *dlopen_file_spec) =0; /** connect to sql database using - @param used_only_to_connect_url + @param url_cstr format is driver specific - WARNING: must be used only to connect, for buffer doesn't live long enough @returns true+'connection' on success. 'error' on failure */ - virtual void connect(char *used_only_in_connect_url_cstr, + virtual void connect(char *url_cstr, SQL_Driver_services& services, void **connection) =0; virtual void disconnect(void *connection) =0; virtual void commit(void *connection) =0; @@ -145,7 +155,9 @@ public: virtual const char* quote(void *connection, const char* str, unsigned int length) =0; virtual void query(void *connection, - const char* statement, unsigned long offset, unsigned long limit, + const char* statement, + size_t placeholders_count, Placeholder* placeholders, + unsigned long offset, unsigned long limit, SQL_Driver_query_event_handlers& handlers) =0; };