SequoiaDB
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
client.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  Copyright (C) 2011-2018 SequoiaDB Ltd.
4 
5  Licensed under the Apache License, Version 2.0 (the "License");
6  you may not use this file except in compliance with the License.
7  You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 *******************************************************************************/
21 #ifndef CLIENT_H__
22 #define CLIENT_H__
23 #include "core.h"
24 #include "ossTypes.h"
25 #include "bson/bson.h"
26 #include "jstobs.h"
27 #include "spd.h"
28 #include "clientDef.h"
29 
30 SDB_EXTERN_C_START
31 
33 #define SDB_PAGESIZE_4K 4096
34 
35 #define SDB_PAGESIZE_8K 8192
36 
37 #define SDB_PAGESIZE_16K 16384
38 
39 #define SDB_PAGESIZE_32K 32768
40 
41 #define SDB_PAGESIZE_64K 65536
42 
43 #define SDB_PAGESIZE_DEFAULT 0
44 
46 {
47  SDB_LOB_CREATEONLY = 0x00000001,
48  SDB_LOB_READ = 0x00000004,
49  SDB_LOB_WRITE = 0x00000008,
50  SDB_LOB_SHAREREAD = 0x00000040
51 } ;
56 
58 {
62 } ;
67 
69 #define SDB_INVALID_HANDLE ((ossValuePtr) 0)
70 
71 typedef ossValuePtr sdbConnectionHandle ;
73 typedef ossValuePtr sdbCSHandle ;
75 typedef ossValuePtr sdbCollectionHandle ;
77 typedef ossValuePtr sdbCursorHandle ;
79 typedef ossValuePtr sdbReplicaGroupHandle ;
81 typedef ossValuePtr sdbNodeHandle ;
83 typedef ossValuePtr sdbDomainHandle ;
85 typedef ossValuePtr sdbLobHandle ;
87 typedef ossValuePtr sdbDCHandle ;
89 typedef ossValuePtr sdbSequenceHandle ;
90 
92 typedef void (*ERROR_ON_REPLY_FUNC)( const CHAR *pErrorObj,
93  UINT32 objSize,
94  INT32 flag,
95  const CHAR *pDescription,
96  const CHAR *pDetail ) ;
97 
102 SDB_EXPORT void sdbSetErrorOnReplyCallback( ERROR_ON_REPLY_FUNC func ) ;
103 
106 
108 #define sdbCreateReplicaNode sdbCreateNode
109 
110 #define sdbRemoveReplicaNode sdbRemoveNode
111 
112 #define sdbGetReplicaNodeMaster sdbGetNodeMaster
113 
114 #define sdbGetReplicaNodeSlave sdbGetNodeSlave
115 
116 #define sdbGetReplicaNodeByName sdbGetNodeByName
117 
118 #define sdbGetReplicaNodeByHost sdbGetNodeByHost
119 
120 #define sdbGetReplicaNodeSddr sdbGetNodeAddr
121 
122 #define sdbStartReplicaNode sdbStartNode
123 
124 #define sdbStopReplicaNode sdbStopNode
125 
126 #define sdbReleaseReplicaNode sdbReleaseNode
127 
129 #define QUERY_FORCE_HINT 0x00000080
130 
131 #define QUERY_PARALLED 0x00000100
132 
133 #define QUERY_WITH_RETURNDATA 0x00000200
134 
135 #define QUERY_PREPARE_MORE 0x00004000
136 
137 #define QUERY_KEEP_SHARDINGKEY_IN_UPDATE 0x00008000
138 
142 #define QUERY_FOR_UPDATE 0x00010000
143 
147 #define QUERY_FOR_SHARE 0x00040000
148 
149 
151 #define FLG_INSERT_CONTONDUP 0x00000001
152 
153 // #define FLG_INSERT_RETURNNUM 0x00000002
155 #define FLG_INSERT_REPLACEONDUP 0x00000004
156 
157 // #define FLG_INSERT_UPDATEONDUP 0x00000008
159 // #define FLG_INSERT_HAS_ID_FIELD 0x00000010
161 #define FLG_INSERT_CONTONDUP_ID 0x00000020
162 
164 #define FLG_INSERT_REPLACEONDUP_ID 0x00000040
165 
166 #define FLG_INSERT_RETURN_OID 0x10000000
167 
169 #define UPDATE_KEEP_SHARDINGKEY QUERY_KEEP_SHARDINGKEY_IN_UPDATE
170 
171 // #define UPDATE_RETURNNUM 0x00000004
172 
174 // #define FLG_DELETE_RETURNNUM 0x00000004
175 
182 SDB_EXPORT INT32 initClient( sdbClientConf* config ) ;
183 
199 SDB_EXPORT INT32 sdbGetPasswdByCipherFile( const CHAR *pUsrName,
200  const CHAR *pToken,
201  const CHAR *pCipherFile,
202  CHAR *pUser, CHAR *pPasswd ) ;
203 
218 SDB_EXPORT INT32 sdbConnect ( const CHAR *pHostName, const CHAR *pServiceName,
219  const CHAR *pUsrName, const CHAR *pPasswd ,
220  sdbConnectionHandle *handle ) ;
221 
234 SDB_EXPORT INT32 sdbConnect1 ( const CHAR **pConnAddrs, INT32 arrSize,
235  const CHAR *pUsrName, const CHAR *pPasswd ,
236  sdbConnectionHandle *handle ) ;
237 
252 SDB_EXPORT INT32 sdbSecureConnect ( const CHAR *pHostName, const CHAR *pServiceName,
253  const CHAR *pUsrName, const CHAR *pPasswd ,
254  sdbConnectionHandle *handle ) ;
255 
268 SDB_EXPORT INT32 sdbSecureConnect1 ( const CHAR **pConnAddrs, INT32 arrSize,
269  const CHAR *pUsrName, const CHAR *pPasswd ,
270  sdbConnectionHandle *handle ) ;
271 
276 SDB_EXPORT void sdbDisconnect ( sdbConnectionHandle handle ) ;
277 
287 SDB_EXPORT INT32 sdbCreateUsr( sdbConnectionHandle cHandle, const CHAR *pUsrName,
288  const CHAR *pPasswd ) ;
289 
299 SDB_EXPORT INT32 sdbRemoveUsr( sdbConnectionHandle cHandle, const CHAR *pUsrName,
300  const CHAR *pPasswd ) ;
301 
302 /* \fn INT32 sdbModifyConfig ( sdbConnectionHandle cHandle,
303  bson *config )
304  \brief Modify config for the current node
305  \param [in] cHandle The connection handle
306  \param [in] config The new configurations
307  \retval SDB_OK Modify Success
308  \retval Others Modify Fail
309 
310 SDB_EXPORT INT32 sdbModifyConfig ( sdbConnectionHandle cHandle,
311  bson *config ) ;*/
312 
313 /* \fn INT32 sdbModifyNodeConfig ( sdbConnectionHandle cHandle,
314  INT32 nodeID,
315  bson *config )
316  \brief Modify config for a given node
317  \param [in] cHandle The connection handle
318  \param [in] nodeID The node id that want to be modified
319  \param [in] config The new configurations
320  \retval SDB_OK Modify Success
321  \retval Others Modify Fail
322 
323 SDB_EXPORT INT32 sdbModifyNodeConfig ( sdbConnectionHandle cHandle,
324  INT32 nodeID,
325  bson *config ) ;*/
326 
350 SDB_EXPORT INT32 sdbGetDataBlocks ( sdbCollectionHandle cHandle,
351  bson *condition,
352  bson *select,
353  bson *orderBy,
354  bson *hint,
355  INT64 numToSkip,
356  INT64 numToReturn,
357  sdbCursorHandle *handle );
358 
380 SDB_EXPORT INT32 sdbGetQueryMeta ( sdbCollectionHandle cHandle,
381  bson *condition,
382  bson *orderBy,
383  bson *hint,
384  INT64 numToSkip,
385  INT64 numToReturn,
386  sdbCursorHandle *handle ) ;
387 
425 SDB_EXPORT INT32 sdbGetSnapshot ( sdbConnectionHandle cHandle,
426  INT32 snapType,
427  bson *condition,
428  bson *selector,
429  bson *orderBy,
430  sdbCursorHandle *handle ) ;
431 
476 SDB_EXPORT INT32 sdbGetSnapshot1 ( sdbConnectionHandle cHandle,
477  INT32 snapType,
478  bson *condition,
479  bson *selector,
480  bson *orderBy,
481  bson *hint,
482  INT64 numToSkip,
483  INT64 numToReturn,
484  sdbCursorHandle *handle ) ;
485 
510 SDB_EXPORT INT32 sdbResetSnapshot ( sdbConnectionHandle cHandle,
511  bson *options ) ;
512 
555 SDB_EXPORT INT32 sdbTraceStart ( sdbConnectionHandle cHandle,
556  UINT32 traceBufferSize,
557  CHAR * component,
558  CHAR * breakPoint ,
559  UINT32 *tids,
560  UINT32 nTids ) ;
567 SDB_EXPORT INT32 sdbTraceResume ( sdbConnectionHandle cHandle ) ;
568 
577 SDB_EXPORT INT32 sdbTraceStop ( sdbConnectionHandle cHandle,
578  const CHAR *pDumpFileName ) ;
579 
588 SDB_EXPORT INT32 sdbTraceStatus ( sdbConnectionHandle cHandle,
589  sdbCursorHandle *handle ) ;
590 
626 SDB_EXPORT INT32 sdbGetList ( sdbConnectionHandle cHandle,
627  INT32 listType,
628  bson *condition,
629  bson *selector,
630  bson *orderBy,
631  sdbCursorHandle *handle ) ;
632 
676 SDB_EXPORT INT32 sdbGetList1( sdbConnectionHandle cHandle,
677  INT32 listType,
678  bson *condition,
679  bson *selector,
680  bson *orderBy,
681  bson *hint,
682  INT64 numToSkip,
683  INT64 numToReturn,
684  sdbCursorHandle *handle ) ;
685 
696 SDB_EXPORT INT32 sdbGetCollection ( sdbConnectionHandle cHandle,
697  const CHAR *pCollectionFullName,
698  sdbCollectionHandle *handle ) ;
699 
710 SDB_EXPORT INT32 sdbGetCollectionSpace ( sdbConnectionHandle cHandle,
711  const CHAR *pCollectionSpaceName,
712  sdbCSHandle *handle ) ;
713 
724 SDB_EXPORT INT32 sdbGetReplicaGroup ( sdbConnectionHandle cHandle,
725  const CHAR *pRGName,
726  sdbReplicaGroupHandle *handle ) ;
727 
738 SDB_EXPORT INT32 sdbGetReplicaGroup1 ( sdbConnectionHandle cHandle,
739  UINT32 id,
740  sdbReplicaGroupHandle *handle ) ;
741 
751 SDB_EXPORT INT32 sdbGetReplicaGroupName ( sdbReplicaGroupHandle cHandle,
752  CHAR **ppRGName ) ;
753 
763 SDB_EXPORT INT32 sdbGetRGName ( sdbReplicaGroupHandle cHandle,
764  CHAR *pBuffer, INT32 size ) ;
765 
772 SDB_EXPORT BOOLEAN sdbIsReplicaGroupCatalog ( sdbReplicaGroupHandle cHandle ) ;
773 
795 SDB_EXPORT INT32 sdbCreateCollectionSpace ( sdbConnectionHandle cHandle,
796  const CHAR *pCollectionSpaceName,
797  INT32 iPageSize,
798  sdbCSHandle *handle ) ;
799 
817 SDB_EXPORT INT32 sdbCreateCollectionSpaceV2 ( sdbConnectionHandle cHandle,
818  const CHAR *pCollectionSpaceName,
819  bson *options,
820  sdbCSHandle *handle ) ;
821 
830 SDB_EXPORT INT32 sdbDropCollectionSpace ( sdbConnectionHandle cHandle,
831  const CHAR *pCollectionSpaceName ) ;
832 
846 SDB_EXPORT INT32 sdbDropCollectionSpace1 ( sdbConnectionHandle cHandle,
847  const CHAR *pCollectionSpaceName,
848  bson *options) ;
849 
860 SDB_EXPORT INT32 sdbCreateReplicaGroup ( sdbConnectionHandle cHandle,
861  const CHAR *pRGName,
862  sdbReplicaGroupHandle *handle ) ;
863 
872 SDB_EXPORT INT32 sdbRemoveReplicaGroup ( sdbConnectionHandle cHandle,
873  const CHAR *pRGName ) ;
874 
881 SDB_EXPORT INT32 sdbStartReplicaGroup ( sdbReplicaGroupHandle cHandle ) ;
882 
891 SDB_EXPORT INT32 sdbGetNodeMaster ( sdbReplicaGroupHandle cHandle,
892  sdbNodeHandle *handle ) ;
893 
903 SDB_EXPORT INT32 sdbGetNodeSlave ( sdbReplicaGroupHandle cHandle,
904  sdbNodeHandle *handle ) ;
905 
920 SDB_EXPORT INT32 sdbGetNodeSlave1 ( sdbReplicaGroupHandle cHandle,
921  const INT32 *positionsArray,
922  INT32 positionsCount,
923  sdbNodeHandle *handle ) ;
924 
925 
937 SDB_EXPORT INT32 sdbGetNodeByName ( sdbReplicaGroupHandle cHandle,
938  const CHAR *pNodeName,
939  sdbNodeHandle *handle ) ;
940 
954 SDB_EXPORT INT32 sdbGetNodeByHost ( sdbReplicaGroupHandle cHandle,
955  const CHAR *pHostName,
956  const CHAR *pServiceName,
957  sdbNodeHandle *handle ) ;
958 
973 SDB_EXPORT INT32 sdbGetNodeAddr ( sdbNodeHandle cHandle,
974  const CHAR **ppHostName,
975  const CHAR **ppServiceName,
976  const CHAR **ppNodeName,
977  INT32 *pNodeID ) ;
978 
985 SDB_EXPORT INT32 sdbStartNode ( sdbNodeHandle cHandle ) ;
986 
993 SDB_EXPORT INT32 sdbStopNode ( sdbNodeHandle cHandle ) ;
994 
1001 SDB_EXPORT INT32 sdbStopReplicaGroup ( sdbReplicaGroupHandle cHandle ) ;
1002 
1017 SDB_EXPORT INT32 sdbCreateReplicaCataGroup ( sdbConnectionHandle cHandle,
1018  const CHAR *pHostName,
1019  const CHAR *pServiceName,
1020  const CHAR *pDatabasePath,
1021  bson *configure );
1022 
1037 SDB_EXPORT INT32 sdbCreateNode ( sdbReplicaGroupHandle cHandle,
1038  const CHAR *pHostName,
1039  const CHAR *pServiceName,
1040  const CHAR *pDatabasePath,
1041  bson *configure ) ;
1042 
1055 SDB_EXPORT INT32 sdbRemoveNode ( sdbReplicaGroupHandle cHandle,
1056  const CHAR *pHostName,
1057  const CHAR *pServiceName,
1058  bson *configure ) ;
1059 
1068 SDB_EXPORT INT32 sdbListCollectionSpaces ( sdbConnectionHandle cHandle,
1069  sdbCursorHandle *handle ) ;
1070 
1079 SDB_EXPORT INT32 sdbListCollections ( sdbConnectionHandle cHandle,
1080  sdbCursorHandle *handle ) ;
1081 
1091 SDB_EXPORT INT32 sdbListSequences ( sdbConnectionHandle cHandle,
1092  sdbCursorHandle *handle ) ;
1093 
1102 SDB_EXPORT INT32 sdbListReplicaGroups ( sdbConnectionHandle cHandle,
1103  sdbCursorHandle *handle ) ;
1104 
1127 SDB_EXPORT INT32 sdbFlushConfigure( sdbConnectionHandle cHandle,
1128  bson *options ) ;
1129 
1138 SDB_EXPORT INT32 sdbCrtJSProcedure( sdbConnectionHandle cHandle,
1139  const CHAR *code ) ;
1140 
1149 SDB_EXPORT INT32 sdbRmProcedure( sdbConnectionHandle cHandle,
1150  const CHAR *spName ) ;
1151 
1152 
1163 SDB_EXPORT INT32 sdbListProcedures( sdbConnectionHandle cHandle,
1164  bson *condition,
1165  sdbCursorHandle *handle ) ;
1166 
1183 SDB_EXPORT INT32 sdbEvalJS( sdbConnectionHandle cHandle,
1184  const CHAR *code,
1185  SDB_SPD_RES_TYPE *type,
1186  sdbCursorHandle *handle,
1187  bson *errmsg ) ;
1188 
1199 SDB_EXPORT INT32 sdbGetCollection1 ( sdbCSHandle cHandle,
1200  const CHAR *pCollectionName,
1201  sdbCollectionHandle *handle ) ;
1202 
1216 SDB_EXPORT INT32 sdbCreateCollection ( sdbCSHandle cHandle,
1217  const CHAR *pCollectionName,
1218  sdbCollectionHandle *handle ) ;
1219 
1261 SDB_EXPORT INT32 sdbCreateCollection1 ( sdbCSHandle cHandle,
1262  const CHAR *pCollectionName,
1263  bson *options,
1264  sdbCollectionHandle *handle ) ;
1265 
1296 SDB_EXPORT INT32 sdbAlterCollection ( sdbCollectionHandle cHandle,
1297  bson *options ) ;
1298 
1307 SDB_EXPORT INT32 sdbDropCollection ( sdbCSHandle cHandle,
1308  const CHAR *pCollectionName ) ;
1309 
1319 SDB_EXPORT INT32 sdbGetCSName ( sdbCSHandle cHandle,
1320  CHAR *pBuffer, INT32 size ) ;
1321 
1334 SDB_EXPORT INT32 sdbRenameCollection( sdbCSHandle cHandle,
1335  const CHAR *pOldName,
1336  const CHAR *pNewName,
1337  bson *options ) ;
1338 
1352 SDB_EXPORT INT32 sdbAlterCollectionSpace ( sdbCSHandle cHandle,
1353  bson * options ) ;
1354 
1366 SDB_EXPORT INT32 sdbCSSetDomain ( sdbCSHandle cHandle,
1367  bson * options ) ;
1368 
1378 SDB_EXPORT INT32 sdbCSGetDomainName ( sdbCSHandle cHandle,
1379  CHAR *pResult, INT32 size ) ;
1380 
1387 SDB_EXPORT INT32 sdbCSRemoveDomain ( sdbCSHandle cHandle ) ;
1388 
1394 SDB_EXPORT INT32 sdbCSEnableCapped ( sdbCSHandle cHandle ) ;
1395 
1402 SDB_EXPORT INT32 sdbCSDisableCapped ( sdbCSHandle cHandle ) ;
1403 
1417 SDB_EXPORT INT32 sdbCSSetAttributes ( sdbCSHandle cHandle,
1418  bson * options ) ;
1419 
1428 SDB_EXPORT INT32 sdbCSListCollections ( sdbCSHandle cHandle,
1429  sdbCursorHandle *handle ) ;
1430 
1440 SDB_EXPORT INT32 sdbGetCLName ( sdbCollectionHandle cHandle,
1441  CHAR *pBuffer, INT32 size ) ;
1442 
1452 SDB_EXPORT INT32 sdbGetCLFullName ( sdbCollectionHandle cHandle,
1453  CHAR *pBuffer, INT32 size ) ;
1454 
1473 SDB_EXPORT INT32 sdbSplitCollection ( sdbCollectionHandle cHandle,
1474  const CHAR *pSourceRG,
1475  const CHAR *pTargetRG,
1476  const bson *pSplitCondition,
1477  const bson *pSplitEndCondition ) ;
1478 
1499 SDB_EXPORT INT32 sdbSplitCLAsync ( sdbCollectionHandle cHandle,
1500  const CHAR *pSourceRG,
1501  const CHAR *pTargetRG,
1502  const bson *pSplitCondition,
1503  const bson *pSplitEndCondition,
1504  SINT64 *taskID ) ;
1505 
1518 SDB_EXPORT INT32 sdbSplitCollectionByPercent ( sdbCollectionHandle cHandle,
1519  const CHAR *pSourceRG,
1520  const CHAR *pTargetRG,
1521  FLOAT64 percent ) ;
1522 
1537 SDB_EXPORT INT32 sdbSplitCLByPercentAsync ( sdbCollectionHandle cHandle,
1538  const CHAR *pSourceRG,
1539  const CHAR *pTargetRG,
1540  FLOAT64 percent,
1541  SINT64 *taskID ) ;
1542 
1558 SDB_EXPORT INT32 sdbCreateIndex ( sdbCollectionHandle cHandle,
1559  bson *indexDef,
1560  const CHAR *pIndexName,
1561  BOOLEAN isUnique,
1562  BOOLEAN isEnforced ) ;
1563 
1582 SDB_EXPORT INT32 sdbCreateIndex1 ( sdbCollectionHandle cHandle,
1583  bson *indexDef,
1584  const CHAR *pIndexName,
1585  BOOLEAN isUnique,
1586  BOOLEAN isEnforced,
1587  INT32 sortBufferSize ) ;
1588 
1609 SDB_EXPORT INT32 sdbCreateIndex2 ( sdbCollectionHandle cHandle,
1610  bson *indexDef,
1611  const CHAR *pIndexName,
1612  bson *options ) ;
1613 
1625 SDB_EXPORT INT32 sdbGetIndexes ( sdbCollectionHandle cHandle,
1626  const CHAR *pIndexName,
1627  sdbCursorHandle *handle ) ;
1628 
1639 SDB_EXPORT INT32 sdbGetIndex ( sdbCollectionHandle cHandle,
1640  const CHAR *pIndexName,
1641  bson *info ) ;
1642 
1643 
1652 SDB_EXPORT INT32 sdbGetIndexInfo ( sdbCollectionHandle cHandle,
1653  sdbCursorHandle *handle ) ;
1654 
1655 
1664 SDB_EXPORT INT32 sdbDropIndex ( sdbCollectionHandle cHandle,
1665  const CHAR *pIndexName ) ;
1666 
1677 SDB_EXPORT INT32 sdbGetCount ( sdbCollectionHandle cHandle,
1678  bson *condition,
1679  SINT64 *count );
1680 
1681 
1697 SDB_EXPORT INT32 sdbGetCount1 ( sdbCollectionHandle cHandle,
1698  bson *condition,
1699  bson *hint,
1700  SINT64 *count );
1701 
1710 SDB_EXPORT INT32 sdbInsert ( sdbCollectionHandle cHandle,
1711  bson *obj ) ;
1712 
1731 SDB_EXPORT INT32 sdbInsert1 ( sdbCollectionHandle cHandle,
1732  bson *obj, bson_iterator *pId ) ;
1733 
1734 
1781 SDB_EXPORT INT32 sdbInsert2 ( sdbCollectionHandle cHandle,
1782  bson *obj, INT32 flags, bson *pResult ) ;
1783 
1840 SDB_EXPORT INT32 sdbBulkInsert ( sdbCollectionHandle cHandle,
1841  SINT32 flags, bson **objs, SINT32 num ) ;
1842 
1892 SDB_EXPORT INT32 sdbBulkInsert2 ( sdbCollectionHandle cHandle,
1893  SINT32 flags, bson **objs,
1894  SINT32 num,
1895  bson *pResult ) ;
1896 
1913 SDB_EXPORT INT32 sdbUpdate ( sdbCollectionHandle cHandle,
1914  bson *rule,
1915  bson *condition,
1916  bson *hint ) ;
1917 
1940 SDB_EXPORT INT32 sdbUpdate1 ( sdbCollectionHandle cHandle,
1941  bson *rule,
1942  bson *condition,
1943  bson *hint,
1944  INT32 flag ) ;
1945 
1979 SDB_EXPORT INT32 sdbUpdate2 ( sdbCollectionHandle cHandle,
1980  bson *rule,
1981  bson *condition,
1982  bson *hint,
1983  INT32 flag,
1984  bson *pResult ) ;
1985 
2002 SDB_EXPORT INT32 sdbUpsert ( sdbCollectionHandle cHandle,
2003  bson *rule,
2004  bson *condition,
2005  bson *hint ) ;
2006 
2025 SDB_EXPORT INT32 sdbUpsert1 ( sdbCollectionHandle cHandle,
2026  bson *rule,
2027  bson *condition,
2028  bson *hint,
2029  bson *setOnInsert ) ;
2030 
2055 SDB_EXPORT INT32 sdbUpsert2 ( sdbCollectionHandle cHandle,
2056  bson *rule,
2057  bson *condition,
2058  bson *hint,
2059  bson *setOnInsert,
2060  INT32 flag ) ;
2061 
2097 SDB_EXPORT INT32 sdbUpsert3 ( sdbCollectionHandle cHandle,
2098  bson *rule,
2099  bson *condition,
2100  bson *hint,
2101  bson *setOnInsert,
2102  INT32 flag,
2103  bson *pResult ) ;
2104 
2118 SDB_EXPORT INT32 sdbDelete ( sdbCollectionHandle cHandle,
2119  bson *condition,
2120  bson *hint ) ;
2121 
2146 SDB_EXPORT INT32 sdbDelete1 ( sdbCollectionHandle cHandle,
2147  bson *condition,
2148  bson *hint,
2149  INT32 flag,
2150  bson *pResult ) ;
2151 
2183 SDB_EXPORT INT32 sdbQuery1 ( sdbCollectionHandle cHandle,
2184  bson *condition,
2185  bson *select,
2186  bson *orderBy,
2187  bson *hint,
2188  INT64 numToSkip,
2189  INT64 numToReturn,
2190  INT32 flags,
2191  sdbCursorHandle *handle ) ;
2192 
2193 
2217 SDB_EXPORT INT32 sdbQuery ( sdbCollectionHandle cHandle,
2218  bson *condition,
2219  bson *select,
2220  bson *orderBy,
2221  bson *hint,
2222  INT64 numToSkip,
2223  INT64 numToReturn,
2224  sdbCursorHandle *handle ) ;
2225 
2262 SDB_EXPORT INT32 sdbQueryAndUpdate ( sdbCollectionHandle cHandle,
2263  bson *condition,
2264  bson *select,
2265  bson *orderBy,
2266  bson *hint,
2267  bson *update,
2268  INT64 numToSkip,
2269  INT64 numToReturn,
2270  INT32 flag,
2271  BOOLEAN returnNew,
2272  sdbCursorHandle *handle ) ;
2273 
2305 SDB_EXPORT INT32 sdbQueryAndRemove ( sdbCollectionHandle cHandle,
2306  bson *condition,
2307  bson *select,
2308  bson *orderBy,
2309  bson *hint,
2310  INT64 numToSkip,
2311  INT64 numToReturn,
2312  INT32 flag,
2313  sdbCursorHandle *handle ) ;
2314 
2351 SDB_EXPORT INT32 sdbExplain ( sdbCollectionHandle cHandle,
2352  bson *condition,
2353  bson *select,
2354  bson *orderBy,
2355  bson *hint,
2356  INT32 flag,
2357  INT64 numToSkip,
2358  INT64 numToReturn,
2359  bson *options,
2360  sdbCursorHandle *handle ) ;
2361 
2370 SDB_EXPORT INT32 sdbNext ( sdbCursorHandle cHandle,
2371  bson *obj ) ;
2372 
2381 SDB_EXPORT INT32 sdbCurrent ( sdbCursorHandle cHandle,
2382  bson *obj ) ;
2383 
2384 /* \fn INT32 sdbUpdateCurrent ( sdbCursorHandle cHandle, bson *rule )
2385  \brief Update the current document of cursor
2386  \param [in] cHandle The cursor handle
2387  \param [in] rule The updating rule, cannot be null
2388  \retval SDB_OK Operation Success
2389  \retval Others Operation Fail
2390 */
2391 /*
2392 SDB_EXPORT INT32 sdbUpdateCurrent ( sdbCursorHandle cHandle,
2393  bson *rule ) ;
2394 */
2395 /* \fn INT32 sdbDeleteCurrent ( sdbCursorHandle cHandle )
2396  \brief Delete the current document of cursor
2397  \param [in] cHandle The cursor handle
2398  \retval SDB_OK Operation Success
2399  \retval Others Operation Fail
2400 */
2401 /*
2402 SDB_EXPORT INT32 sdbDeleteCurrent ( sdbCursorHandle cHandle ) ;
2403 */
2404 
2413 SDB_EXPORT INT32 sdbCloseCursor ( sdbCursorHandle cHandle ) ;
2414 
2422 SDB_EXPORT INT32 sdbCloseAllCursors ( sdbConnectionHandle cHandle ) ;
2423 
2431 SDB_EXPORT INT32 sdbInterrupt ( sdbConnectionHandle cHandle ) ;
2432 
2442 SDB_EXPORT INT32 sdbInterruptOperation ( sdbConnectionHandle cHandle ) ;
2443 
2444 
2455 SDB_EXPORT INT32 sdbExec( sdbConnectionHandle cHandle,
2456  const CHAR *sql,
2457  sdbCursorHandle *result );
2458 
2467 SDB_EXPORT INT32 sdbExecUpdate( sdbConnectionHandle cHandle,
2468  const CHAR *sql ) ;
2469 
2476 SDB_EXPORT INT32 sdbTransactionBegin( sdbConnectionHandle cHandle ) ;
2477 
2484 SDB_EXPORT INT32 sdbTransactionCommit( sdbConnectionHandle cHandle ) ;
2485 
2492 SDB_EXPORT INT32 sdbTransactionRollback( sdbConnectionHandle cHandle ) ;
2493 
2498 SDB_EXPORT void sdbReleaseConnection ( sdbConnectionHandle cHandle ) ;
2499 
2504 SDB_EXPORT void sdbReleaseCollection ( sdbCollectionHandle cHandle ) ;
2505 
2510 SDB_EXPORT void sdbReleaseCS ( sdbCSHandle cHandle ) ;
2511 
2516 SDB_EXPORT void sdbReleaseCursor ( sdbCursorHandle cHandle ) ;
2517 
2522 SDB_EXPORT void sdbReleaseReplicaGroup ( sdbReplicaGroupHandle cHandle ) ;
2523 
2528 SDB_EXPORT void sdbReleaseNode ( sdbNodeHandle cHandle ) ;
2529 
2534 SDB_EXPORT void sdbReleaseDomain ( sdbDomainHandle cHandle ) ;
2535 
2536 /* \fn void sdbReleaseDC ( sdbDCHandle cHandle )
2537  \brief Release the data center handle
2538  \param [in] cHandle the data center handle
2539 */
2540 SDB_EXPORT void sdbReleaseDC ( sdbDCHandle cHandle ) ;
2541 
2585 SDB_EXPORT INT32 sdbAggregate ( sdbCollectionHandle cHandle,
2586  bson **obj, SINT32 num,
2587  sdbCursorHandle *handle ) ;
2588 
2600 SDB_EXPORT INT32 sdbAttachCollection ( sdbCollectionHandle cHandle,
2601  const CHAR *subClFullName,
2602  bson *options) ;
2603 
2612 SDB_EXPORT INT32 sdbDetachCollection ( sdbCollectionHandle cHandle,
2613  const CHAR *subClFullName) ;
2614 
2636 SDB_EXPORT INT32 sdbBackupOffline ( sdbConnectionHandle cHandle,
2637  bson *options) ;
2638 
2658 SDB_EXPORT INT32 sdbBackup ( sdbConnectionHandle cHandle, bson *options) ;
2659 
2684 SDB_EXPORT INT32 sdbListBackup ( sdbConnectionHandle cHandle,
2685  bson *options,
2686  bson *condition,
2687  bson *selector,
2688  bson *orderBy,
2689  sdbCursorHandle *handle ) ;
2690 
2707 SDB_EXPORT INT32 sdbRemoveBackup ( sdbConnectionHandle cHandle,
2708  bson *options) ;
2709 
2729 SDB_EXPORT INT32 sdbListTasks ( sdbConnectionHandle cHandle,
2730  bson *condition,
2731  bson *selector,
2732  bson *orderBy,
2733  bson *hint,
2734  sdbCursorHandle *handle ) ;
2735 
2746 SDB_EXPORT INT32 sdbWaitTasks ( sdbConnectionHandle cHandle,
2747  const SINT64 *taskIDs,
2748  SINT32 num );
2749 
2761 SDB_EXPORT INT32 sdbCancelTask ( sdbConnectionHandle cHandle,
2762  SINT64 taskID,
2763  BOOLEAN isAsync ) ;
2764 
2777 SDB_EXPORT INT32 sdbSetSessionAttr ( sdbConnectionHandle cHandle,
2778  bson *options ) ;
2779 
2788 SDB_EXPORT INT32 sdbGetSessionAttr ( sdbConnectionHandle cHandle,
2789  bson * result ) ;
2790 
2801 SDB_EXPORT INT32 sdbGetSessionAttrEx ( sdbConnectionHandle cHandle,
2802  BOOLEAN useCache,
2803  bson * result ) ;
2804 
2810 SDB_EXPORT BOOLEAN sdbIsClosed( sdbConnectionHandle cHandle ) ;
2811 
2817 SDB_EXPORT BOOLEAN sdbIsValid( sdbConnectionHandle cHandle ) ;
2818 
2819 SDB_EXPORT INT32 _sdbMsg ( sdbConnectionHandle cHandle, const CHAR *msg ) ;
2820 
2841 SDB_EXPORT INT32 sdbCreateDomain ( sdbConnectionHandle cHandle,
2842  const CHAR *pDomainName,
2843  bson *options,
2844  sdbDomainHandle *handle ) ;
2845 
2854 SDB_EXPORT INT32 sdbDropDomain ( sdbConnectionHandle cHandle,
2855  const CHAR *pDomainName ) ;
2856 
2867 SDB_EXPORT INT32 sdbGetDomain ( sdbConnectionHandle cHandle,
2868  const CHAR *pDomainName,
2869  sdbDomainHandle *handle ) ;
2870 
2889 SDB_EXPORT INT32 sdbListDomains ( sdbConnectionHandle cHandle,
2890  bson *condition,
2891  bson *selector,
2892  bson *orderBy,
2893  sdbCursorHandle *handle ) ;
2894 
2914 SDB_EXPORT INT32 sdbAlterDomain( sdbDomainHandle cHandle,
2915  const bson *options ) ;
2916 
2929 SDB_EXPORT INT32 sdbDomainAddGroups ( sdbDomainHandle cHandle,
2930  const bson * options ) ;
2931 
2945 SDB_EXPORT INT32 sdbDomainRemoveGroups ( sdbDomainHandle cHandle,
2946  const bson * options ) ;
2947 
2962 SDB_EXPORT INT32 sdbDomainSetGroups ( sdbDomainHandle cHandle,
2963  const bson * options ) ;
2964 
2984 SDB_EXPORT INT32 sdbDomainSetAttributes ( sdbDomainHandle cHandle,
2985  const bson * options ) ;
2986 
2995 SDB_EXPORT INT32 sdbListCollectionSpacesInDomain( sdbDomainHandle cHandle,
2996  sdbCursorHandle *cursor ) ;
2997 
3006 SDB_EXPORT INT32 sdbListCollectionsInDomain( sdbDomainHandle cHandle,
3007  sdbCursorHandle *cursor ) ;
3008 
3017 SDB_EXPORT INT32 sdbListGroupsInDomain( sdbDomainHandle cHandle,
3018  sdbCursorHandle *cursor ) ;
3019 
3039 SDB_EXPORT INT32 sdbInvalidateCache( sdbConnectionHandle cHandle,
3040  bson *options ) ;
3041 
3052 SDB_EXPORT INT32 sdbForceSession( sdbConnectionHandle cHandle,
3053  SINT64 sessionID,
3054  bson *options ) ;
3055 
3064 SDB_EXPORT INT32 sdbCreateLobID( sdbCollectionHandle cHandle,
3065  bson_oid_t *oid ) ;
3066 
3079 SDB_EXPORT INT32 sdbCreateLobID1( sdbCollectionHandle cHandle,
3080  const CHAR *pTimeStamp,
3081  bson_oid_t *oid ) ;
3082 
3091 SDB_EXPORT INT32 sdbGetLobId( sdbLobHandle lobHandle,
3092  bson_oid_t *oid ) ;
3093 
3107 SDB_EXPORT INT32 sdbOpenLob( sdbCollectionHandle cHandle,
3108  const bson_oid_t *oid,
3109  INT32 mode,
3110  sdbLobHandle *lobHandle ) ;
3111 
3122 SDB_EXPORT INT32 sdbWriteLob( sdbLobHandle lobHandle,
3123  const CHAR *buf,
3124  UINT32 len ) ;
3125 
3136 SDB_EXPORT INT32 sdbLockLob( sdbLobHandle lobHandle,
3137  INT64 offset,
3138  INT64 length ) ;
3139 
3150 SDB_EXPORT INT32 sdbLockAndSeekLob( sdbLobHandle lobHandle,
3151  INT64 offset,
3152  INT64 length ) ;
3153 
3166 SDB_EXPORT INT32 sdbReadLob( sdbLobHandle lobHandle,
3167  UINT32 len,
3168  CHAR *buf,
3169  UINT32 *read ) ;
3170 
3177 SDB_EXPORT INT32 sdbCloseLob( sdbLobHandle *lobHandle ) ;
3178 
3187 SDB_EXPORT INT32 sdbRemoveLob( sdbCollectionHandle cHandle,
3188  const bson_oid_t *oid ) ;
3189 
3199 SDB_EXPORT INT32 sdbTruncateLob( sdbCollectionHandle cHandle,
3200  const bson_oid_t *oid, INT64 length ) ;
3201 
3210 SDB_EXPORT INT32 sdbGetLobSize( sdbLobHandle lobHandle,
3211  SINT64 *size ) ;
3212 
3221 SDB_EXPORT INT32 sdbGetLobCreateTime( sdbLobHandle lobHandle,
3222  UINT64 *millis ) ;
3223 
3232 SDB_EXPORT INT32 sdbGetLobModificationTime( sdbLobHandle lobHandle,
3233  UINT64 *millis ) ;
3234 
3241 SDB_EXPORT BOOLEAN sdbLobIsEof( sdbLobHandle lobHandle ) ;
3242 
3243 
3254 SDB_EXPORT INT32 sdbSeekLob( sdbLobHandle lobHandle,
3255  SINT64 size,
3256  SDB_LOB_SEEK whence ) ;
3257 
3266 SDB_EXPORT INT32 sdbListLobs( sdbCollectionHandle cHandle,
3267  sdbCursorHandle *cursor) ;
3268 
3290 SDB_EXPORT INT32 sdbListLobs1( sdbCollectionHandle cHandle,
3291  bson *condition,
3292  bson *selected,
3293  bson *orderBy,
3294  bson *hint,
3295  INT64 numToSkip,
3296  INT64 numToReturn,
3297  sdbCursorHandle *cursor) ;
3298 
3307 SDB_EXPORT INT32 sdbListLobPieces( sdbCollectionHandle cHandle,
3308  sdbCursorHandle *cursor ) ;
3309 
3310 
3332 SDB_EXPORT INT32 sdbListLobPieces1( sdbCollectionHandle cHandle,
3333  bson *condition,
3334  bson *selected,
3335  bson *orderBy,
3336  bson *hint,
3337  INT64 numToSkip,
3338  INT64 numToReturn,
3339  sdbCursorHandle *cursor ) ;
3340 
3347 SDB_EXPORT INT32 sdbGetRunTimeDetail( sdbLobHandle lobHandle,
3348  bson *detail) ;
3349 
3350 
3360 SDB_EXPORT INT32 sdbReelect( sdbReplicaGroupHandle cHandle,
3361  const bson *options ) ;
3362 
3370 SDB_EXPORT INT32 sdbForceStepUp( sdbConnectionHandle cHandle,
3371  const bson *options ) ;
3372 
3381 SDB_EXPORT INT32 sdbTruncateCollection( sdbConnectionHandle cHandle,
3382  const CHAR *fullName ) ;
3383 
3403 SDB_EXPORT INT32 sdbDetachNode( sdbReplicaGroupHandle cHandle,
3404  const CHAR *hostName,
3405  const CHAR *serviceName,
3406  const bson *options ) ;
3407 
3425 SDB_EXPORT INT32 sdbAttachNode( sdbReplicaGroupHandle cHandle,
3426  const CHAR *hostName,
3427  const CHAR *serviceName,
3428  const bson *options ) ;
3429 
3440 SDB_EXPORT INT32 sdbCreateIdIndex( sdbCollectionHandle cHandle,
3441  const bson *args ) ;
3442 
3450 SDB_EXPORT INT32 sdbDropIdIndex( sdbCollectionHandle cHandle ) ;
3451 
3464 SDB_EXPORT INT32 sdbEnableSharding ( sdbCollectionHandle cHandle,
3465  const bson * args ) ;
3466 
3473 SDB_EXPORT INT32 sdbDisableSharding ( sdbCollectionHandle cHandle ) ;
3474 
3484 SDB_EXPORT INT32 sdbEnableCompression ( sdbCollectionHandle cHandle,
3485  const bson * args ) ;
3486 
3493 SDB_EXPORT INT32 sdbDisableCompression ( sdbCollectionHandle cHandle ) ;
3494 
3512 SDB_EXPORT INT32 sdbCreateAutoIncrement( sdbCollectionHandle cHandle,
3513  const bson * options ) ;
3514 
3524 SDB_EXPORT INT32 sdbDropAutoIncrement( sdbCollectionHandle cHandle,
3525  const bson * options ) ;
3526 
3547 SDB_EXPORT INT32 sdbCLSetAttributes ( sdbCollectionHandle cHandle,
3548  const bson *options ) ;
3549 
3558 SDB_EXPORT INT32 sdbCLGetDetail ( sdbCollectionHandle cHandle,
3559  sdbCursorHandle *handle ) ;
3560 
3569 SDB_EXPORT INT32 sdbCLGetCollectionStat ( sdbCollectionHandle cHandle,
3570  bson *result ) ;
3571 
3582 SDB_EXPORT INT32 sdbCLGetIndexStat( sdbCollectionHandle cHandle,
3583  const CHAR *pIndexName,
3584  bson *result ) ;
3585 
3598 SDB_EXPORT INT32 sdbCLGetIndexStat1( sdbCollectionHandle cHandle,
3599  const CHAR *pIndexName,
3600  bson *result,
3601  BOOLEAN detail ) ;
3602 
3603 /* \fn INT32 sdbPop( sdbCollectionHandle cHandle, bson *options )
3604  \brief pop records from capped collection
3605  \param [in] cHandle The handle of connection
3606  \param [in] fullName The full name of collection to be popped, eg: foo.bar
3607  \param [in] options Pop target and direction, including "LogicalID" and "Direction".
3608  Direction is optional. Its default value is 1.
3609  e.g. { LogicalID:100, Direction:1 }
3610  \retval SDB_OK Operation Success
3611  \retval Others Operation Fail
3612 */
3613 SDB_EXPORT INT32 sdbPop( sdbCollectionHandle cHandle, bson *options ) ;
3614 
3615 /* \fn INT32 sdbGetDCName( sdbDCHandle cHandle, CHAR *pBuffer, INT32 size )
3616  \brief Get the name of the data center
3617  \param [in] cHandle The data center handle
3618  \param [in] pBuffer The output buffer
3619  \param [in] size The size of the output buffer
3620  \retval SDB_OK Operation Success
3621  \retval Others Operation Fail
3622 */
3623 SDB_EXPORT INT32 sdbGetDCName( sdbDCHandle cHandle, CHAR *pBuffer, INT32 size ) ;
3624 
3625 /* \fn INT32 sdbGetDC( sdbConnectionHandle cHandle, sdbDCHandle *handle )
3626  \brief Get the data center
3627  \param [in] cHandle The connection handle
3628  \param [out] handle The data center handle
3629  \retval SDB_OK Operation Success
3630  \retval Others Operation Fail
3631 */
3632 SDB_EXPORT INT32 sdbGetDC( sdbConnectionHandle cHandle, sdbDCHandle *handle ) ;
3633 
3634 /* \fn INT32 sdbGetDCDetail( sdbDCHandle cHandle, bson *retInfo )
3635  \brief Get the detail of data center
3636  \param [in] cHandle The connection handle
3637  \param [out] retInfo The the detail of data center
3638  \retval SDB_OK Operation Success
3639  \retval Others Operation Fail
3640 */
3641 SDB_EXPORT INT32 sdbGetDCDetail( sdbDCHandle cHandle, bson *retInfo ) ;
3642 
3643 /* \fn INT32 sdbActivateDC( sdbDCHandle cHandle )
3644  \brief Activate the data center
3645  \param [in] cHandle The data center handle
3646  \retval SDB_OK Operation Success
3647  \retval Others Operation Fail
3648 */
3649 SDB_EXPORT INT32 sdbActivateDC( sdbDCHandle cHandle ) ;
3650 
3651 /* \fn INT32 sdbDeactivateDC( sdbDCHandle cHandle )
3652  \brief Deactivate the data center
3653  \param [in] cHandle The data center handle
3654  \retval SDB_OK Operation Success
3655  \retval Others Operation Fail
3656 */
3657 SDB_EXPORT INT32 sdbDeactivateDC( sdbDCHandle cHandle ) ;
3658 
3659 /* \fn INT32 sdbEnableReadOnly( sdbDCHandle cHandle, BOOLEAN isReadOnly )
3660  \brief Enable data center works in readonly mode or not
3661  \param [in] cHandle The data center handle
3662  \param [in] isReadOnly Whether to use readonly mode or not
3663  \retval SDB_OK Operation Success
3664  \retval Others Operation Fail
3665 */
3666 SDB_EXPORT INT32 sdbEnableReadOnly( sdbDCHandle cHandle, BOOLEAN isReadOnly ) ;
3667 
3668 /* \fn INT32 sdbCreateImage( sdbDCHandle cHandle, const CHAR *pCataAddrList )
3669  \brief Create image in data center
3670  \param [in] cHandle The data center handle
3671  \param [in] pCataAddrList Catalog address list of remote data center, e.g. "192.168.20.165:30003",
3672  "192.168.20.165:30003,192.168.20.166:30003"
3673  \retval SDB_OK Operation Success
3674  \retval Others Operation Fail
3675 */
3676 SDB_EXPORT INT32 sdbCreateImage( sdbDCHandle cHandle, const CHAR *pCataAddrList ) ;
3677 
3678 /* \fn INT32 sdbRemoveImage( sdbDCHandle cHandle )
3679  \brief Remove image in data center
3680  \param [in] cHandle The data center handle
3681  \retval SDB_OK Operation Success
3682  \retval Others Operation Fail
3683 */
3684 SDB_EXPORT INT32 sdbRemoveImage( sdbDCHandle cHandle ) ;
3685 
3686 /* \fn INT32 sdbEnableImage( sdbDCHandle cHandle )
3687  \brief Enable image in data center
3688  \param [in] cHandle The data center handle
3689  \retval SDB_OK Operation Success
3690  \retval Others Operation Fail
3691 */
3692 SDB_EXPORT INT32 sdbEnableImage( sdbDCHandle cHandle ) ;
3693 
3694 /* \fn INT32 sdbDisableImage( sdbDCHandle cHandle )
3695  \brief Disable image in data center
3696  \param [in] cHandle The data center handle
3697  \retval SDB_OK Operation Success
3698  \retval Others Operation Fail
3699 */
3700 SDB_EXPORT INT32 sdbDisableImage( sdbDCHandle cHandle ) ;
3701 
3702 /* \fn INT32 sdbAttachGroups( sdbDCHandle cHandle, bson *info )
3703  \brief Attach specified groups to data center
3704  \param [in] cHandle The data center handle
3705  \param [in] info The information of groups to attach, e.g. {Groups:[["group1", "group1"], ["group2", "group2"]]}
3706  \code
3707  bson obj ;
3708  bson_init( &obj ) ;
3709  bson_append_start_array( &obj, "Groups" ) ;
3710 
3711  bson_append_start_array( &obj, "0" ) ;
3712  bson_append_string( &obj, "0", "group1" ) ;
3713  bson_append_string( &obj, "1", "group1" ) ;
3714  bson_append_finish_array( &obj ) ;
3715 
3716  bson_append_start_array( &obj, "0" ) ;
3717  bson_append_string( &obj, "0", "group2" ) ;
3718  bson_append_string( &obj, "1", "group2" ) ;
3719  bson_append_finish_array( &obj ) ;
3720 
3721  bson_append_finish_array( &obj ) ;
3722 
3723  rc = bson_finish( &obj ) ;
3724  ASSERT_EQ( SDB_OK, rc ) ;
3725 
3726  rc = sdbAttachGroups( dc, &obj ) ;
3727  ASSERT_EQ( SDB_OK, rc ) ;
3728 
3729  bson_destroy( &obj ) ;
3730  \endcode
3731  \retval SDB_OK Operation Success
3732  \retval Others Operation Fail
3733 */
3734 SDB_EXPORT INT32 sdbAttachGroups( sdbDCHandle cHandle, bson *info ) ;
3735 
3736 /* \fn INT32 sdbDetachGroups( sdbDCHandle cHandle, bson *info )
3737  \brief Detach specified groups from data center
3738  \param [in] cHandle The data center handle
3739  \param [in] info The information of groups to detach, e.g. {Groups:[["a", "a"], ["b", "b"]]}
3740  \retval SDB_OK Operation Success
3741  \retval Others Operation Fail
3742 */
3743 SDB_EXPORT INT32 sdbDetachGroups( sdbDCHandle cHandle, bson *info ) ;
3744 
3768 SDB_EXPORT INT32 sdbSyncDB( sdbConnectionHandle cHandle,
3769  bson *options ) ;
3770 
3787 SDB_EXPORT INT32 sdbLoadCollectionSpace( sdbConnectionHandle cHandle,
3788  const CHAR *csName,
3789  bson *options ) ;
3790 
3807 SDB_EXPORT INT32 sdbUnloadCollectionSpace( sdbConnectionHandle cHandle,
3808  const CHAR *csName,
3809  bson *options ) ;
3810 
3827 SDB_EXPORT INT32 sdbSetPDLevel( sdbConnectionHandle cHandle,
3828  INT32 pdLevel,
3829  bson *options ) ;
3830 
3845 SDB_EXPORT INT32 sdbReloadConfig( sdbConnectionHandle cHandle,
3846  bson *options ) ;
3847 
3863 SDB_EXPORT INT32 sdbUpdateConfig( sdbConnectionHandle cHandle,
3864  bson *configs, bson *options ) ;
3865 
3881 SDB_EXPORT INT32 sdbDeleteConfig( sdbConnectionHandle cHandle,
3882  bson *configs, bson *options ) ;
3883 
3896 SDB_EXPORT INT32 sdbRenameCollectionSpace( sdbConnectionHandle cHandle,
3897  const CHAR *pOldName,
3898  const CHAR *pNewName,
3899  bson *options ) ;
3900 
3908 SDB_EXPORT void sdbSetConnectionInterruptFunc(
3909  sdbConnectionHandle cHandle,
3910  socketInterruptFunc func ) ;
3911 
3939 SDB_EXPORT INT32 sdbAnalyze( sdbConnectionHandle cHandle,
3940  bson *options ) ;
3941 
3954 SDB_EXPORT INT32 sdbGetLastErrorObj( sdbConnectionHandle cHandle, bson *errObj ) ;
3955 
3960 SDB_EXPORT void sdbCleanLastErrorObj( sdbConnectionHandle cHandle ) ;
3961 
3985 SDB_EXPORT INT32 sdbCreateSequence( sdbConnectionHandle cHandle,
3986  const CHAR *pSequenceName,
3987  const bson *options,
3988  sdbSequenceHandle *sHandle ) ;
3989 
4000 SDB_EXPORT INT32 sdbGetSequence( sdbConnectionHandle cHandle,
4001  const CHAR *pSequenceName,
4002  sdbSequenceHandle *sHandle ) ;
4003 
4014 SDB_EXPORT INT32 sdbRenameSequence( sdbConnectionHandle cHandle,
4015  const CHAR *pOldName,
4016  const CHAR *pNewName ) ;
4017 
4026 SDB_EXPORT INT32 sdbDropSequence( sdbConnectionHandle cHandle,
4027  const CHAR *pSequenceName ) ;
4028 
4033 SDB_EXPORT void sdbReleaseSequence( sdbSequenceHandle sHandle ) ;
4034 
4053 SDB_EXPORT INT32 sdbSeqSetAttributes( sdbSequenceHandle sHandle,
4054  const bson *options ) ;
4055 
4063 SDB_EXPORT INT32 sdbSeqGetNextValue( sdbSequenceHandle sHandle, INT64 *value ) ;
4064 
4072 SDB_EXPORT INT32 sdbSeqGetCurrentValue( sdbSequenceHandle sHandle,
4073  INT64 *value ) ;
4074 
4083 SDB_EXPORT INT32 sdbSeqSetCurrentValue( sdbSequenceHandle sHandle,
4084  const INT64 value ) ;
4085 
4100 SDB_EXPORT INT32 sdbSeqFetch( sdbSequenceHandle sHandle,
4101  const INT32 fetchNum,
4102  INT64 *nextValue,
4103  INT32 *returnNum,
4104  INT32 *increment ) ;
4105 
4113 SDB_EXPORT INT32 sdbSeqRestart( sdbSequenceHandle sHandle,
4114  const INT64 startValue ) ;
4115 
4116 SDB_EXTERN_C_END
4117 #endif