ZOO-Project
Functions | Variables
sqlapi.c File Reference
#include "ogr_api.h"
#include "ogrsf_frmts.h"
#include "ogr_p.h"
#include "response_print.h"
#include <fcgi_stdio.h>
#include "sqlapi.h"
#include "service_callback.h"

Functions

char * _createInitString (maps *conf, const char *key)
 Create a GDAL / OGR string for connecting to a db backend defined in the key section. More...
 
char * createInitString (maps *conf)
 Create a GDAL / OGR string for connecting to the db backend. More...
 
int _init_sql (maps *conf, const char *key)
 Connect to a db backend. More...
 
int init_sql (maps *conf)
 Connect to the db backend. More...
 
void close_sql (maps *conf, int cid)
 Close any connection to the db backend. More...
 
void end_sql ()
 Call OGRCleanupAll. More...
 
OGRLayer * fetchSql (maps *conf, int cid, const char *sqlQuery)
 Fetch a tuple set by executing a SQL query to the Database Backend. More...
 
void cleanFetchSql (maps *conf, int cid, OGRLayer *objects)
 
int execSql (maps *conf, int cid, const char *sqlQuery)
 Execute a SQL query to the SQL Database Backend. More...
 
void cleanUpResultSet (const maps *conf, int cid)
 Clean any memory allocated by executing a request. More...
 

Variables

OGRDataSource ** zoo_DS = NULL
 Global GDALDataset pointer. More...
 
OGRLayer * zoo_ResultSet = NULL
 Global OGRLayer pointer pointing to the lastest result set. More...
 

Function Documentation

char* _createInitString ( maps conf,
const char *  key 
)

Create a GDAL / OGR string for connecting to a db backend defined in the key section.

Parameters
confthe maps containing the setting of the main.cfg file
keythe name of the section containing the connection setting
Returns
the OGR connection string
int _init_sql ( maps conf,
const char *  key 
)

Connect to a db backend.

Parameters
confthe maps containing the setting of the main.cfg file
See also
createInitString
void cleanFetchSql ( maps conf,
int  cid,
OGRLayer *  objects 
)
void cleanUpResultSet ( const maps conf,
int  cid 
)

Clean any memory allocated by executing a request.

Parameters
confthe maps containing the setting of the main.cfg file
sqlQuerythe SQL query to run
Returns
-1 in case of failure and 1 if the query succeed.
void close_sql ( maps conf,
int  cid 
)

Close any connection to the db backend.

Parameters
confthe maps containing the setting of the main.cfg file
char* createInitString ( maps conf)

Create a GDAL / OGR string for connecting to the db backend.

Parameters
confthe maps containing the setting of the main.cfg file
Returns
the OGR connection string
void end_sql ( )

Call OGRCleanupAll.

int execSql ( maps conf,
int  cid,
const char *  sqlQuery 
)

Execute a SQL query to the SQL Database Backend.

Parameters
confthe maps containing the setting of the main.cfg file
sqlQuerythe SQL query to run
Returns
-1 in case of failure and 1 if the query succeed.
OGRLayer* fetchSql ( maps conf,
int  cid,
const char *  sqlQuery 
)

Fetch a tuple set by executing a SQL query to the Database Backend.

Parameters
confthe maps containing the setting of the main.cfg file
sqlQuerythe SQL query to run
Returns
NULL in case of failure or an OGRLayer pointer if the query succeed.
int init_sql ( maps conf)

Connect to the db backend.

Parameters
confthe maps containing the setting of the main.cfg file
See also
createInitString

Variable Documentation

OGRDataSource** zoo_DS = NULL

Global GDALDataset pointer.

OGRLayer* zoo_ResultSet = NULL

Global OGRLayer pointer pointing to the lastest result set.