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

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: 
        !             8:        $Id: pa_array.h,v 1.34 2001/04/03 05:23:40 paf Exp $
        !             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: 
        !            36: /// sQl-driver API
        !            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
        !            44:        virtual bool connect(const char *url, void **info, char **error) =0;
        !            45:        /// disconnect
        !            46:        virtual void disconnect(void *info) =0;
        !            47:        /// log error message
        !            48:        //static void log(Pool& pool, const char *fmt, ...);
        !            49: };
        !            50: 
        !            51: typedef SQL_Driver *(*SQL_Driver_create_func)();
        !            52: 
        !            53: #endif

E-mail: