Annotation of parser3/src/include/pa_sql_driver.h, revision 1.4

1.1       paf         1: /** @file
                      2:        Parser: sql driver interface.
                      3: 
                      4:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
                      5: 
                      6:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
                      7: 
1.4     ! paf         8:        $Id: pa_sql_driver.h,v 1.3 2001/04/04 12:13:19 paf Exp $
1.1       paf         9: 
                     10: 
                     11:        driver dynamic library must look like this:
                     12:        @code
                     13:                class X_SQL_Driver : public SQL_Driver {
                     14:                public:
                     15: 
                     16:                        X_SQL_Driver() : SQL_driver() {}
                     17: 
                     18:                        int version() { return SQL_API_VERSION; }
                     19:                        
                     20:                        //...
                     21:                };
                     22: 
                     23:                extern "C" SQL_Driver *create() {
                     24:                        return new X_SQL_Driver();
                     25:                }       
                     26:        @endcode
                     27: */
                     28: 
                     29: #ifndef PA_SQL_DRIVER_H
                     30: #define PA_SQL_DRIVER_H
                     31: 
                     32: #include "pa_pool.h"
                     33: 
                     34: #define SQL_API_VERSION 0x0300
                     35: 
1.2       paf        36: /// SQL driver API
1.1       paf        37: class SQL_Driver {
                     38: public:
                     39: 
                     40:        SQL_Driver() {}
                     41:        /// get api version
                     42:        virtual int api_version() =0;
                     43:        /// connect. @returns true+'info' on success. 'error' on failure
1.4     ! paf        44:        virtual const char *connect(char *url, void **info) =0;
        !            45:        virtual const char *disconnect(void *info) =0;
        !            46:        virtual const char *commit(void *info) =0;
        !            47:        virtual const char *rollback(void *info) =0;
1.1       paf        48:        /// log error message
                     49:        //static void log(Pool& pool, const char *fmt, ...);
                     50: };
                     51: 
                     52: typedef SQL_Driver *(*SQL_Driver_create_func)();
                     53: 
                     54: #endif

E-mail: