submitting patch from enterprise version
[csql.git] / include / TableConfig.h
blob04cf74451c36119388786fcba941c76b10d7f6d1
1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 ***************************************************************************/
16 #include <CSql.h>
17 #include <sql.h>
18 #include <sqlext.h>
19 #include <Network.h>
21 class TableConfig
23 char tableName[IDENTIFIER_LENGTH];
24 char fieldName[IDENTIFIER_LENGTH];
25 char userName[IDENTIFIER_LENGTH];
26 char password[IDENTIFIER_LENGTH];
27 char conditionVal[IDENTIFIER_LENGTH]; //added newly
28 char fieldlistVal[IDENTIFIER_LENGTH];
29 bool shouldForce;
30 public:
31 TableConfig()
33 strcpy(tableName,"");
34 strcpy(conditionVal,"");
35 strcpy(fieldName,"");
36 strcpy(fieldlistVal,"");
37 shouldForce = false;
39 void setForceFlag(bool flag){ shouldForce = flag;}
40 void setConnParam(char *user, char *pass){ strcpy(userName, user); strcpy(password, pass); }
41 void setTable(char *tablename) { strcpy(tableName,tablename); }
42 void setCondition(char *condition){strcpy(conditionVal,condition);} //new one
43 void setFieldName(char *fldname){ strcpy(fieldName,fldname);}
44 DbRetVal addToCacheTableFile(bool isDirect);
45 static int getTableMode(char *tabname);
46 void setFieldListVal(char *field) {strcpy(fieldlistVal,field);}
48 DbRetVal addToCacheTableFile();
49 DbRetVal removeFromCacheTableFile();
50 // DbRetVal load(bool tabDef=true);
51 // DbRetVal reload();
52 // DbRetVal unload(bool tabDefinition = true);
53 // DbRetVal refresh();
54 // DbRetVal recoverAllCachedTables();
55 // DbRetVal load(DatabaseManager *dbMgr, bool tabDef);
56 static DbRetVal isTableCached(char *tablename);
57 DbRetVal isTablePresent();// new one by :Jitendra
58 bool isFieldExist(char *fieldname);
59 DbRetVal CacheInfo(bool isTabPresent);
60 char *getRealConditionFromFile(char *condition);
61 char *getConditionVal(char *condition);
64 class TableConf
66 public:
67 static TableConfig config;
71 class BindBuffer
73 public:
74 void *csql;
75 void *targetdb;
76 DataType type;
79 class CacheTableInfo
81 public:
82 char tableName[IDENTIFIER_LENGTH];
83 char fieldName[IDENTIFIER_LENGTH];
84 char projFieldlist[IDENTIFIER_LENGTH];
85 char condition[IDENTIFIER_LENGTH];
87 void setTableName(char *tblName){strcpy(tableName,tblName);}
88 void setFieldName(char *fldName){strcpy(fieldName,fldName);}
89 void setProjFieldList(char *fieldlist){ strcpy(projFieldlist,fieldlist);}
90 void setCondition(char *cond){ strcpy(condition,cond);}
91 char *getTableName(){return tableName;}
92 char *getFieldName(){return fieldName;}
93 char *getCondition(){ return condition;}
94 char *getProjFieldList(){return projFieldlist;}
95 };*/