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 
143 #define QUERY_FOR_UPDATE 0x00010000
144 
145 
147 #define FLG_INSERT_CONTONDUP 0x00000001
148 
149 // #define FLG_INSERT_RETURNNUM 0x00000002
151 #define FLG_INSERT_REPLACEONDUP 0x00000004
152 
153 // #define FLG_INSERT_UPDATEONDUP 0x00000008
155 // #define FLG_INSERT_HAS_ID_FIELD 0x00000010
157 #define FLG_INSERT_CONTONDUP_ID 0x00000020
158 
160 #define FLG_INSERT_REPLACEONDUP_ID 0x00000040
161 
162 #define FLG_INSERT_RETURN_OID 0x10000000
163 
165 #define UPDATE_KEEP_SHARDINGKEY QUERY_KEEP_SHARDINGKEY_IN_UPDATE
166 
167 // #define UPDATE_RETURNNUM 0x00000004
168 
170 // #define FLG_DELETE_RETURNNUM 0x00000004
171 
178 SDB_EXPORT INT32 initClient( sdbClientConf* config ) ;
179 
195 SDB_EXPORT INT32 sdbGetPasswdByCipherFile( const CHAR *pUsrName,
196  const CHAR *pToken,
197  const CHAR *pCipherFile,
198  CHAR *pUser, CHAR *pPasswd ) ;
199 
214 SDB_EXPORT INT32 sdbConnect ( const CHAR *pHostName, const CHAR *pServiceName,
215  const CHAR *pUsrName, const CHAR *pPasswd ,
216  sdbConnectionHandle *handle ) ;
217 
230 SDB_EXPORT INT32 sdbConnect1 ( const CHAR **pConnAddrs, INT32 arrSize,
231  const CHAR *pUsrName, const CHAR *pPasswd ,
232  sdbConnectionHandle *handle ) ;
233 
248 SDB_EXPORT INT32 sdbSecureConnect ( const CHAR *pHostName, const CHAR *pServiceName,
249  const CHAR *pUsrName, const CHAR *pPasswd ,
250  sdbConnectionHandle *handle ) ;
251 
264 SDB_EXPORT INT32 sdbSecureConnect1 ( const CHAR **pConnAddrs, INT32 arrSize,
265  const CHAR *pUsrName, const CHAR *pPasswd ,
266  sdbConnectionHandle *handle ) ;
267 
272 SDB_EXPORT void sdbDisconnect ( sdbConnectionHandle handle ) ;
273 
283 SDB_EXPORT INT32 sdbCreateUsr( sdbConnectionHandle cHandle, const CHAR *pUsrName,
284  const CHAR *pPasswd ) ;
285 
295 SDB_EXPORT INT32 sdbRemoveUsr( sdbConnectionHandle cHandle, const CHAR *pUsrName,
296  const CHAR *pPasswd ) ;
297 
298 /* \fn INT32 sdbModifyConfig ( sdbConnectionHandle cHandle,
299  bson *config )
300  \brief Modify config for the current node
301  \param [in] cHandle The connection handle
302  \param [in] config The new configurations
303  \retval SDB_OK Modify Success
304  \retval Others Modify Fail
305 
306 SDB_EXPORT INT32 sdbModifyConfig ( sdbConnectionHandle cHandle,
307  bson *config ) ;*/
308 
309 /* \fn INT32 sdbModifyNodeConfig ( sdbConnectionHandle cHandle,
310  INT32 nodeID,
311  bson *config )
312  \brief Modify config for a given node
313  \param [in] cHandle The connection handle
314  \param [in] nodeID The node id that want to be modified
315  \param [in] config The new configurations
316  \retval SDB_OK Modify Success
317  \retval Others Modify Fail
318 
319 SDB_EXPORT INT32 sdbModifyNodeConfig ( sdbConnectionHandle cHandle,
320  INT32 nodeID,
321  bson *config ) ;*/
322 
346 SDB_EXPORT INT32 sdbGetDataBlocks ( sdbCollectionHandle cHandle,
347  bson *condition,
348  bson *select,
349  bson *orderBy,
350  bson *hint,
351  INT64 numToSkip,
352  INT64 numToReturn,
353  sdbCursorHandle *handle );
354 
376 SDB_EXPORT INT32 sdbGetQueryMeta ( sdbCollectionHandle cHandle,
377  bson *condition,
378  bson *orderBy,
379  bson *hint,
380  INT64 numToSkip,
381  INT64 numToReturn,
382  sdbCursorHandle *handle ) ;
383 
421 SDB_EXPORT INT32 sdbGetSnapshot ( sdbConnectionHandle cHandle,
422  INT32 snapType,
423  bson *condition,
424  bson *selector,
425  bson *orderBy,
426  sdbCursorHandle *handle ) ;
427 
472 SDB_EXPORT INT32 sdbGetSnapshot1 ( sdbConnectionHandle cHandle,
473  INT32 snapType,
474  bson *condition,
475  bson *selector,
476  bson *orderBy,
477  bson *hint,
478  INT64 numToSkip,
479  INT64 numToReturn,
480  sdbCursorHandle *handle ) ;
481 
506 SDB_EXPORT INT32 sdbResetSnapshot ( sdbConnectionHandle cHandle,
507  bson *options ) ;
508 
551 SDB_EXPORT INT32 sdbTraceStart ( sdbConnectionHandle cHandle,
552  UINT32 traceBufferSize,
553  CHAR * component,
554  CHAR * breakPoint ,
555  UINT32 *tids,
556  UINT32 nTids ) ;
563 SDB_EXPORT INT32 sdbTraceResume ( sdbConnectionHandle cHandle ) ;
564 
573 SDB_EXPORT INT32 sdbTraceStop ( sdbConnectionHandle cHandle,
574  const CHAR *pDumpFileName ) ;
575 
584 SDB_EXPORT INT32 sdbTraceStatus ( sdbConnectionHandle cHandle,
585  sdbCursorHandle *handle ) ;
586 
622 SDB_EXPORT INT32 sdbGetList ( sdbConnectionHandle cHandle,
623  INT32 listType,
624  bson *condition,
625  bson *selector,
626  bson *orderBy,
627  sdbCursorHandle *handle ) ;
628 
672 SDB_EXPORT INT32 sdbGetList1( sdbConnectionHandle cHandle,
673  INT32 listType,
674  bson *condition,
675  bson *selector,
676  bson *orderBy,
677  bson *hint,
678  INT64 numToSkip,
679  INT64 numToReturn,
680  sdbCursorHandle *handle ) ;
681 
692 SDB_EXPORT INT32 sdbGetCollection ( sdbConnectionHandle cHandle,
693  const CHAR *pCollectionFullName,
694  sdbCollectionHandle *handle ) ;
695 
706 SDB_EXPORT INT32 sdbGetCollectionSpace ( sdbConnectionHandle cHandle,
707  const CHAR *pCollectionSpaceName,
708  sdbCSHandle *handle ) ;
709 
720 SDB_EXPORT INT32 sdbGetReplicaGroup ( sdbConnectionHandle cHandle,
721  const CHAR *pRGName,
722  sdbReplicaGroupHandle *handle ) ;
723 
734 SDB_EXPORT INT32 sdbGetReplicaGroup1 ( sdbConnectionHandle cHandle,
735  UINT32 id,
736  sdbReplicaGroupHandle *handle ) ;
737 
747 SDB_EXPORT INT32 sdbGetReplicaGroupName ( sdbReplicaGroupHandle cHandle,
748  CHAR **ppRGName ) ;
749 
759 SDB_EXPORT INT32 sdbGetRGName ( sdbReplicaGroupHandle cHandle,
760  CHAR *pBuffer, INT32 size ) ;
761 
768 SDB_EXPORT BOOLEAN sdbIsReplicaGroupCatalog ( sdbReplicaGroupHandle cHandle ) ;
769 
791 SDB_EXPORT INT32 sdbCreateCollectionSpace ( sdbConnectionHandle cHandle,
792  const CHAR *pCollectionSpaceName,
793  INT32 iPageSize,
794  sdbCSHandle *handle ) ;
795 
813 SDB_EXPORT INT32 sdbCreateCollectionSpaceV2 ( sdbConnectionHandle cHandle,
814  const CHAR *pCollectionSpaceName,
815  bson *options,
816  sdbCSHandle *handle ) ;
817 
826 SDB_EXPORT INT32 sdbDropCollectionSpace ( sdbConnectionHandle cHandle,
827  const CHAR *pCollectionSpaceName ) ;
828 
842 SDB_EXPORT INT32 sdbDropCollectionSpace1 ( sdbConnectionHandle cHandle,
843  const CHAR *pCollectionSpaceName,
844  bson *options) ;
845 
856 SDB_EXPORT INT32 sdbCreateReplicaGroup ( sdbConnectionHandle cHandle,
857  const CHAR *pRGName,
858  sdbReplicaGroupHandle *handle ) ;
859 
868 SDB_EXPORT INT32 sdbRemoveReplicaGroup ( sdbConnectionHandle cHandle,
869  const CHAR *pRGName ) ;
870 
877 SDB_EXPORT INT32 sdbStartReplicaGroup ( sdbReplicaGroupHandle cHandle ) ;
878 
887 SDB_EXPORT INT32 sdbGetNodeMaster ( sdbReplicaGroupHandle cHandle,
888  sdbNodeHandle *handle ) ;
889 
899 SDB_EXPORT INT32 sdbGetNodeSlave ( sdbReplicaGroupHandle cHandle,
900  sdbNodeHandle *handle ) ;
901 
916 SDB_EXPORT INT32 sdbGetNodeSlave1 ( sdbReplicaGroupHandle cHandle,
917  const INT32 *positionsArray,
918  INT32 positionsCount,
919  sdbNodeHandle *handle ) ;
920 
921 
933 SDB_EXPORT INT32 sdbGetNodeByName ( sdbReplicaGroupHandle cHandle,
934  const CHAR *pNodeName,
935  sdbNodeHandle *handle ) ;
936 
950 SDB_EXPORT INT32 sdbGetNodeByHost ( sdbReplicaGroupHandle cHandle,
951  const CHAR *pHostName,
952  const CHAR *pServiceName,
953  sdbNodeHandle *handle ) ;
954 
969 SDB_EXPORT INT32 sdbGetNodeAddr ( sdbNodeHandle cHandle,
970  const CHAR **ppHostName,
971  const CHAR **ppServiceName,
972  const CHAR **ppNodeName,
973  INT32 *pNodeID ) ;
974 
981 SDB_EXPORT INT32 sdbStartNode ( sdbNodeHandle cHandle ) ;
982 
989 SDB_EXPORT INT32 sdbStopNode ( sdbNodeHandle cHandle ) ;
990 
997 SDB_EXPORT INT32 sdbStopReplicaGroup ( sdbReplicaGroupHandle cHandle ) ;
998 
1013 SDB_EXPORT INT32 sdbCreateReplicaCataGroup ( sdbConnectionHandle cHandle,
1014  const CHAR *pHostName,
1015  const CHAR *pServiceName,
1016  const CHAR *pDatabasePath,
1017  bson *configure );
1018 
1033 SDB_EXPORT INT32 sdbCreateNode ( sdbReplicaGroupHandle cHandle,
1034  const CHAR *pHostName,
1035  const CHAR *pServiceName,
1036  const CHAR *pDatabasePath,
1037  bson *configure ) ;
1038 
1051 SDB_EXPORT INT32 sdbRemoveNode ( sdbReplicaGroupHandle cHandle,
1052  const CHAR *pHostName,
1053  const CHAR *pServiceName,
1054  bson *configure ) ;
1055 
1064 SDB_EXPORT INT32 sdbListCollectionSpaces ( sdbConnectionHandle cHandle,
1065  sdbCursorHandle *handle ) ;
1066 
1075 SDB_EXPORT INT32 sdbListCollections ( sdbConnectionHandle cHandle,
1076  sdbCursorHandle *handle ) ;
1077 
1087 SDB_EXPORT INT32 sdbListSequences ( sdbConnectionHandle cHandle,
1088  sdbCursorHandle *handle ) ;
1089 
1098 SDB_EXPORT INT32 sdbListReplicaGroups ( sdbConnectionHandle cHandle,
1099  sdbCursorHandle *handle ) ;
1100 
1123 SDB_EXPORT INT32 sdbFlushConfigure( sdbConnectionHandle cHandle,
1124  bson *options ) ;
1125 
1134 SDB_EXPORT INT32 sdbCrtJSProcedure( sdbConnectionHandle cHandle,
1135  const CHAR *code ) ;
1136 
1145 SDB_EXPORT INT32 sdbRmProcedure( sdbConnectionHandle cHandle,
1146  const CHAR *spName ) ;
1147 
1148 
1159 SDB_EXPORT INT32 sdbListProcedures( sdbConnectionHandle cHandle,
1160  bson *condition,
1161  sdbCursorHandle *handle ) ;
1162 
1179 SDB_EXPORT INT32 sdbEvalJS( sdbConnectionHandle cHandle,
1180  const CHAR *code,
1181  SDB_SPD_RES_TYPE *type,
1182  sdbCursorHandle *handle,
1183  bson *errmsg ) ;
1184 
1195 SDB_EXPORT INT32 sdbGetCollection1 ( sdbCSHandle cHandle,
1196  const CHAR *pCollectionName,
1197  sdbCollectionHandle *handle ) ;
1198 
1212 SDB_EXPORT INT32 sdbCreateCollection ( sdbCSHandle cHandle,
1213  const CHAR *pCollectionName,
1214  sdbCollectionHandle *handle ) ;
1215 
1257 SDB_EXPORT INT32 sdbCreateCollection1 ( sdbCSHandle cHandle,
1258  const CHAR *pCollectionName,
1259  bson *options,
1260  sdbCollectionHandle *handle ) ;
1261 
1292 SDB_EXPORT INT32 sdbAlterCollection ( sdbCollectionHandle cHandle,
1293  bson *options ) ;
1294 
1303 SDB_EXPORT INT32 sdbDropCollection ( sdbCSHandle cHandle,
1304  const CHAR *pCollectionName ) ;
1305 
1315 SDB_EXPORT INT32 sdbGetCSName ( sdbCSHandle cHandle,
1316  CHAR *pBuffer, INT32 size ) ;
1317 
1330 SDB_EXPORT INT32 sdbRenameCollection( sdbCSHandle cHandle,
1331  const CHAR *pOldName,
1332  const CHAR *pNewName,
1333  bson *options ) ;
1334 
1348 SDB_EXPORT INT32 sdbAlterCollectionSpace ( sdbCSHandle cHandle,
1349  bson * options ) ;
1350 
1362 SDB_EXPORT INT32 sdbCSSetDomain ( sdbCSHandle cHandle,
1363  bson * options ) ;
1364 
1374 SDB_EXPORT INT32 sdbCSGetDomainName ( sdbCSHandle cHandle,
1375  CHAR *pResult, INT32 size ) ;
1376 
1383 SDB_EXPORT INT32 sdbCSRemoveDomain ( sdbCSHandle cHandle ) ;
1384 
1390 SDB_EXPORT INT32 sdbCSEnableCapped ( sdbCSHandle cHandle ) ;
1391 
1398 SDB_EXPORT INT32 sdbCSDisableCapped ( sdbCSHandle cHandle ) ;
1399 
1413 SDB_EXPORT INT32 sdbCSSetAttributes ( sdbCSHandle cHandle,
1414  bson * options ) ;
1415 
1424 SDB_EXPORT INT32 sdbCSListCollections ( sdbCSHandle cHandle,
1425  sdbCursorHandle *handle ) ;
1426 
1436 SDB_EXPORT INT32 sdbGetCLName ( sdbCollectionHandle cHandle,
1437  CHAR *pBuffer, INT32 size ) ;
1438 
1448 SDB_EXPORT INT32 sdbGetCLFullName ( sdbCollectionHandle cHandle,
1449  CHAR *pBuffer, INT32 size ) ;
1450 
1469 SDB_EXPORT INT32 sdbSplitCollection ( sdbCollectionHandle cHandle,
1470  const CHAR *pSourceRG,
1471  const CHAR *pTargetRG,
1472  const bson *pSplitCondition,
1473  const bson *pSplitEndCondition ) ;
1474 
1495 SDB_EXPORT INT32 sdbSplitCLAsync ( sdbCollectionHandle cHandle,
1496  const CHAR *pSourceRG,
1497  const CHAR *pTargetRG,
1498  const bson *pSplitCondition,
1499  const bson *pSplitEndCondition,
1500  SINT64 *taskID ) ;
1501 
1514 SDB_EXPORT INT32 sdbSplitCollectionByPercent ( sdbCollectionHandle cHandle,
1515  const CHAR *pSourceRG,
1516  const CHAR *pTargetRG,
1517  FLOAT64 percent ) ;
1518 
1533 SDB_EXPORT INT32 sdbSplitCLByPercentAsync ( sdbCollectionHandle cHandle,
1534  const CHAR *pSourceRG,
1535  const CHAR *pTargetRG,
1536  FLOAT64 percent,
1537  SINT64 *taskID ) ;
1538 
1554 SDB_EXPORT INT32 sdbCreateIndex ( sdbCollectionHandle cHandle,
1555  bson *indexDef,
1556  const CHAR *pIndexName,
1557  BOOLEAN isUnique,
1558  BOOLEAN isEnforced ) ;
1559 
1578 SDB_EXPORT INT32 sdbCreateIndex1 ( sdbCollectionHandle cHandle,
1579  bson *indexDef,
1580  const CHAR *pIndexName,
1581  BOOLEAN isUnique,
1582  BOOLEAN isEnforced,
1583  INT32 sortBufferSize ) ;
1584 
1605 SDB_EXPORT INT32 sdbCreateIndex2 ( sdbCollectionHandle cHandle,
1606  bson *indexDef,
1607  const CHAR *pIndexName,
1608  bson *options ) ;
1609 
1621 SDB_EXPORT INT32 sdbGetIndexes ( sdbCollectionHandle cHandle,
1622  const CHAR *pIndexName,
1623  sdbCursorHandle *handle ) ;
1624 
1635 SDB_EXPORT INT32 sdbGetIndex ( sdbCollectionHandle cHandle,
1636  const CHAR *pIndexName,
1637  bson *info ) ;
1638 
1639 
1648 SDB_EXPORT INT32 sdbGetIndexInfo ( sdbCollectionHandle cHandle,
1649  sdbCursorHandle *handle ) ;
1650 
1651 
1660 SDB_EXPORT INT32 sdbDropIndex ( sdbCollectionHandle cHandle,
1661  const CHAR *pIndexName ) ;
1662 
1673 SDB_EXPORT INT32 sdbGetCount ( sdbCollectionHandle cHandle,
1674  bson *condition,
1675  SINT64 *count );
1676 
1677 
1693 SDB_EXPORT INT32 sdbGetCount1 ( sdbCollectionHandle cHandle,
1694  bson *condition,
1695  bson *hint,
1696  SINT64 *count );
1697 
1706 SDB_EXPORT INT32 sdbInsert ( sdbCollectionHandle cHandle,
1707  bson *obj ) ;
1708 
1727 SDB_EXPORT INT32 sdbInsert1 ( sdbCollectionHandle cHandle,
1728  bson *obj, bson_iterator *pId ) ;
1729 
1730 
1777 SDB_EXPORT INT32 sdbInsert2 ( sdbCollectionHandle cHandle,
1778  bson *obj, INT32 flags, bson *pResult ) ;
1779 
1836 SDB_EXPORT INT32 sdbBulkInsert ( sdbCollectionHandle cHandle,
1837  SINT32 flags, bson **objs, SINT32 num ) ;
1838 
1888 SDB_EXPORT INT32 sdbBulkInsert2 ( sdbCollectionHandle cHandle,
1889  SINT32 flags, bson **objs,
1890  SINT32 num,
1891  bson *pResult ) ;
1892 
1909 SDB_EXPORT INT32 sdbUpdate ( sdbCollectionHandle cHandle,
1910  bson *rule,
1911  bson *condition,
1912  bson *hint ) ;
1913 
1936 SDB_EXPORT INT32 sdbUpdate1 ( sdbCollectionHandle cHandle,
1937  bson *rule,
1938  bson *condition,
1939  bson *hint,
1940  INT32 flag ) ;
1941 
1975 SDB_EXPORT INT32 sdbUpdate2 ( sdbCollectionHandle cHandle,
1976  bson *rule,
1977  bson *condition,
1978  bson *hint,
1979  INT32 flag,
1980  bson *pResult ) ;
1981 
1998 SDB_EXPORT INT32 sdbUpsert ( sdbCollectionHandle cHandle,
1999  bson *rule,
2000  bson *condition,
2001  bson *hint ) ;
2002 
2021 SDB_EXPORT INT32 sdbUpsert1 ( sdbCollectionHandle cHandle,
2022  bson *rule,
2023  bson *condition,
2024  bson *hint,
2025  bson *setOnInsert ) ;
2026 
2051 SDB_EXPORT INT32 sdbUpsert2 ( sdbCollectionHandle cHandle,
2052  bson *rule,
2053  bson *condition,
2054  bson *hint,
2055  bson *setOnInsert,
2056  INT32 flag ) ;
2057 
2093 SDB_EXPORT INT32 sdbUpsert3 ( sdbCollectionHandle cHandle,
2094  bson *rule,
2095  bson *condition,
2096  bson *hint,
2097  bson *setOnInsert,
2098  INT32 flag,
2099  bson *pResult ) ;
2100 
2114 SDB_EXPORT INT32 sdbDelete ( sdbCollectionHandle cHandle,
2115  bson *condition,
2116  bson *hint ) ;
2117 
2142 SDB_EXPORT INT32 sdbDelete1 ( sdbCollectionHandle cHandle,
2143  bson *condition,
2144  bson *hint,
2145  INT32 flag,
2146  bson *pResult ) ;
2147 
2179 SDB_EXPORT INT32 sdbQuery1 ( sdbCollectionHandle cHandle,
2180  bson *condition,
2181  bson *select,
2182  bson *orderBy,
2183  bson *hint,
2184  INT64 numToSkip,
2185  INT64 numToReturn,
2186  INT32 flags,
2187  sdbCursorHandle *handle ) ;
2188 
2189 
2213 SDB_EXPORT INT32 sdbQuery ( sdbCollectionHandle cHandle,
2214  bson *condition,
2215  bson *select,
2216  bson *orderBy,
2217  bson *hint,
2218  INT64 numToSkip,
2219  INT64 numToReturn,
2220  sdbCursorHandle *handle ) ;
2221 
2258 SDB_EXPORT INT32 sdbQueryAndUpdate ( sdbCollectionHandle cHandle,
2259  bson *condition,
2260  bson *select,
2261  bson *orderBy,
2262  bson *hint,
2263  bson *update,
2264  INT64 numToSkip,
2265  INT64 numToReturn,
2266  INT32 flag,
2267  BOOLEAN returnNew,
2268  sdbCursorHandle *handle ) ;
2269 
2301 SDB_EXPORT INT32 sdbQueryAndRemove ( sdbCollectionHandle cHandle,
2302  bson *condition,
2303  bson *select,
2304  bson *orderBy,
2305  bson *hint,
2306  INT64 numToSkip,
2307  INT64 numToReturn,
2308  INT32 flag,
2309  sdbCursorHandle *handle ) ;
2310 
2347 SDB_EXPORT INT32 sdbExplain ( sdbCollectionHandle cHandle,
2348  bson *condition,
2349  bson *select,
2350  bson *orderBy,
2351  bson *hint,
2352  INT32 flag,
2353  INT64 numToSkip,
2354  INT64 numToReturn,
2355  bson *options,
2356  sdbCursorHandle *handle ) ;
2357 
2366 SDB_EXPORT INT32 sdbNext ( sdbCursorHandle cHandle,
2367  bson *obj ) ;
2368 
2377 SDB_EXPORT INT32 sdbCurrent ( sdbCursorHandle cHandle,
2378  bson *obj ) ;
2379 
2380 /* \fn INT32 sdbUpdateCurrent ( sdbCursorHandle cHandle, bson *rule )
2381  \brief Update the current document of cursor
2382  \param [in] cHandle The cursor handle
2383  \param [in] rule The updating rule, cannot be null
2384  \retval SDB_OK Operation Success
2385  \retval Others Operation Fail
2386 */
2387 /*
2388 SDB_EXPORT INT32 sdbUpdateCurrent ( sdbCursorHandle cHandle,
2389  bson *rule ) ;
2390 */
2391 /* \fn INT32 sdbDeleteCurrent ( sdbCursorHandle cHandle )
2392  \brief Delete the current document of cursor
2393  \param [in] cHandle The cursor handle
2394  \retval SDB_OK Operation Success
2395  \retval Others Operation Fail
2396 */
2397 /*
2398 SDB_EXPORT INT32 sdbDeleteCurrent ( sdbCursorHandle cHandle ) ;
2399 */
2400 
2409 SDB_EXPORT INT32 sdbCloseCursor ( sdbCursorHandle cHandle ) ;
2410 
2418 SDB_EXPORT INT32 sdbCloseAllCursors ( sdbConnectionHandle cHandle ) ;
2419 
2427 SDB_EXPORT INT32 sdbInterrupt ( sdbConnectionHandle cHandle ) ;
2428 
2438 SDB_EXPORT INT32 sdbInterruptOperation ( sdbConnectionHandle cHandle ) ;
2439 
2440 
2451 SDB_EXPORT INT32 sdbExec( sdbConnectionHandle cHandle,
2452  const CHAR *sql,
2453  sdbCursorHandle *result );
2454 
2463 SDB_EXPORT INT32 sdbExecUpdate( sdbConnectionHandle cHandle,
2464  const CHAR *sql ) ;
2465 
2472 SDB_EXPORT INT32 sdbTransactionBegin( sdbConnectionHandle cHandle ) ;
2473 
2480 SDB_EXPORT INT32 sdbTransactionCommit( sdbConnectionHandle cHandle ) ;
2481 
2488 SDB_EXPORT INT32 sdbTransactionRollback( sdbConnectionHandle cHandle ) ;
2489 
2494 SDB_EXPORT void sdbReleaseConnection ( sdbConnectionHandle cHandle ) ;
2495 
2500 SDB_EXPORT void sdbReleaseCollection ( sdbCollectionHandle cHandle ) ;
2501 
2506 SDB_EXPORT void sdbReleaseCS ( sdbCSHandle cHandle ) ;
2507 
2512 SDB_EXPORT void sdbReleaseCursor ( sdbCursorHandle cHandle ) ;
2513 
2518 SDB_EXPORT void sdbReleaseReplicaGroup ( sdbReplicaGroupHandle cHandle ) ;
2519 
2524 SDB_EXPORT void sdbReleaseNode ( sdbNodeHandle cHandle ) ;
2525 
2530 SDB_EXPORT void sdbReleaseDomain ( sdbDomainHandle cHandle ) ;
2531 
2532 /* \fn void sdbReleaseDC ( sdbDCHandle cHandle )
2533  \brief Release the data center handle
2534  \param [in] cHandle the data center handle
2535 */
2536 SDB_EXPORT void sdbReleaseDC ( sdbDCHandle cHandle ) ;
2537 
2581 SDB_EXPORT INT32 sdbAggregate ( sdbCollectionHandle cHandle,
2582  bson **obj, SINT32 num,
2583  sdbCursorHandle *handle ) ;
2584 
2596 SDB_EXPORT INT32 sdbAttachCollection ( sdbCollectionHandle cHandle,
2597  const CHAR *subClFullName,
2598  bson *options) ;
2599 
2608 SDB_EXPORT INT32 sdbDetachCollection ( sdbCollectionHandle cHandle,
2609  const CHAR *subClFullName) ;
2610 
2632 SDB_EXPORT INT32 sdbBackupOffline ( sdbConnectionHandle cHandle,
2633  bson *options) ;
2634 
2654 SDB_EXPORT INT32 sdbBackup ( sdbConnectionHandle cHandle, bson *options) ;
2655 
2680 SDB_EXPORT INT32 sdbListBackup ( sdbConnectionHandle cHandle,
2681  bson *options,
2682  bson *condition,
2683  bson *selector,
2684  bson *orderBy,
2685  sdbCursorHandle *handle ) ;
2686 
2703 SDB_EXPORT INT32 sdbRemoveBackup ( sdbConnectionHandle cHandle,
2704  bson *options) ;
2705 
2725 SDB_EXPORT INT32 sdbListTasks ( sdbConnectionHandle cHandle,
2726  bson *condition,
2727  bson *selector,
2728  bson *orderBy,
2729  bson *hint,
2730  sdbCursorHandle *handle ) ;
2731 
2742 SDB_EXPORT INT32 sdbWaitTasks ( sdbConnectionHandle cHandle,
2743  const SINT64 *taskIDs,
2744  SINT32 num );
2745 
2757 SDB_EXPORT INT32 sdbCancelTask ( sdbConnectionHandle cHandle,
2758  SINT64 taskID,
2759  BOOLEAN isAsync ) ;
2760 
2773 SDB_EXPORT INT32 sdbSetSessionAttr ( sdbConnectionHandle cHandle,
2774  bson *options ) ;
2775 
2784 SDB_EXPORT INT32 sdbGetSessionAttr ( sdbConnectionHandle cHandle,
2785  bson * result ) ;
2786 
2797 SDB_EXPORT INT32 sdbGetSessionAttrEx ( sdbConnectionHandle cHandle,
2798  BOOLEAN useCache,
2799  bson * result ) ;
2800 
2806 SDB_EXPORT BOOLEAN sdbIsClosed( sdbConnectionHandle cHandle ) ;
2807 
2813 SDB_EXPORT BOOLEAN sdbIsValid( sdbConnectionHandle cHandle ) ;
2814 
2815 SDB_EXPORT INT32 _sdbMsg ( sdbConnectionHandle cHandle, const CHAR *msg ) ;
2816 
2837 SDB_EXPORT INT32 sdbCreateDomain ( sdbConnectionHandle cHandle,
2838  const CHAR *pDomainName,
2839  bson *options,
2840  sdbDomainHandle *handle ) ;
2841 
2850 SDB_EXPORT INT32 sdbDropDomain ( sdbConnectionHandle cHandle,
2851  const CHAR *pDomainName ) ;
2852 
2863 SDB_EXPORT INT32 sdbGetDomain ( sdbConnectionHandle cHandle,
2864  const CHAR *pDomainName,
2865  sdbDomainHandle *handle ) ;
2866 
2885 SDB_EXPORT INT32 sdbListDomains ( sdbConnectionHandle cHandle,
2886  bson *condition,
2887  bson *selector,
2888  bson *orderBy,
2889  sdbCursorHandle *handle ) ;
2890 
2910 SDB_EXPORT INT32 sdbAlterDomain( sdbDomainHandle cHandle,
2911  const bson *options ) ;
2912 
2925 SDB_EXPORT INT32 sdbDomainAddGroups ( sdbDomainHandle cHandle,
2926  const bson * options ) ;
2927 
2941 SDB_EXPORT INT32 sdbDomainRemoveGroups ( sdbDomainHandle cHandle,
2942  const bson * options ) ;
2943 
2958 SDB_EXPORT INT32 sdbDomainSetGroups ( sdbDomainHandle cHandle,
2959  const bson * options ) ;
2960 
2980 SDB_EXPORT INT32 sdbDomainSetAttributes ( sdbDomainHandle cHandle,
2981  const bson * options ) ;
2982 
2991 SDB_EXPORT INT32 sdbListCollectionSpacesInDomain( sdbDomainHandle cHandle,
2992  sdbCursorHandle *cursor ) ;
2993 
3002 SDB_EXPORT INT32 sdbListCollectionsInDomain( sdbDomainHandle cHandle,
3003  sdbCursorHandle *cursor ) ;
3004 
3013 SDB_EXPORT INT32 sdbListGroupsInDomain( sdbDomainHandle cHandle,
3014  sdbCursorHandle *cursor ) ;
3015 
3035 SDB_EXPORT INT32 sdbInvalidateCache( sdbConnectionHandle cHandle,
3036  bson *options ) ;
3037 
3048 SDB_EXPORT INT32 sdbForceSession( sdbConnectionHandle cHandle,
3049  SINT64 sessionID,
3050  bson *options ) ;
3051 
3060 SDB_EXPORT INT32 sdbCreateLobID( sdbCollectionHandle cHandle,
3061  bson_oid_t *oid ) ;
3062 
3075 SDB_EXPORT INT32 sdbCreateLobID1( sdbCollectionHandle cHandle,
3076  const CHAR *pTimeStamp,
3077  bson_oid_t *oid ) ;
3078 
3087 SDB_EXPORT INT32 sdbGetLobId( sdbLobHandle lobHandle,
3088  bson_oid_t *oid ) ;
3089 
3103 SDB_EXPORT INT32 sdbOpenLob( sdbCollectionHandle cHandle,
3104  const bson_oid_t *oid,
3105  INT32 mode,
3106  sdbLobHandle *lobHandle ) ;
3107 
3118 SDB_EXPORT INT32 sdbWriteLob( sdbLobHandle lobHandle,
3119  const CHAR *buf,
3120  UINT32 len ) ;
3121 
3132 SDB_EXPORT INT32 sdbLockLob( sdbLobHandle lobHandle,
3133  INT64 offset,
3134  INT64 length ) ;
3135 
3146 SDB_EXPORT INT32 sdbLockAndSeekLob( sdbLobHandle lobHandle,
3147  INT64 offset,
3148  INT64 length ) ;
3149 
3162 SDB_EXPORT INT32 sdbReadLob( sdbLobHandle lobHandle,
3163  UINT32 len,
3164  CHAR *buf,
3165  UINT32 *read ) ;
3166 
3173 SDB_EXPORT INT32 sdbCloseLob( sdbLobHandle *lobHandle ) ;
3174 
3183 SDB_EXPORT INT32 sdbRemoveLob( sdbCollectionHandle cHandle,
3184  const bson_oid_t *oid ) ;
3185 
3195 SDB_EXPORT INT32 sdbTruncateLob( sdbCollectionHandle cHandle,
3196  const bson_oid_t *oid, INT64 length ) ;
3197 
3206 SDB_EXPORT INT32 sdbGetLobSize( sdbLobHandle lobHandle,
3207  SINT64 *size ) ;
3208 
3217 SDB_EXPORT INT32 sdbGetLobCreateTime( sdbLobHandle lobHandle,
3218  UINT64 *millis ) ;
3219 
3228 SDB_EXPORT INT32 sdbGetLobModificationTime( sdbLobHandle lobHandle,
3229  UINT64 *millis ) ;
3230 
3237 SDB_EXPORT BOOLEAN sdbLobIsEof( sdbLobHandle lobHandle ) ;
3238 
3239 
3250 SDB_EXPORT INT32 sdbSeekLob( sdbLobHandle lobHandle,
3251  SINT64 size,
3252  SDB_LOB_SEEK whence ) ;
3253 
3262 SDB_EXPORT INT32 sdbListLobs( sdbCollectionHandle cHandle,
3263  sdbCursorHandle *cursor) ;
3264 
3286 SDB_EXPORT INT32 sdbListLobs1( sdbCollectionHandle cHandle,
3287  bson *condition,
3288  bson *selected,
3289  bson *orderBy,
3290  bson *hint,
3291  INT64 numToSkip,
3292  INT64 numToReturn,
3293  sdbCursorHandle *cursor) ;
3294 
3303 SDB_EXPORT INT32 sdbListLobPieces( sdbCollectionHandle cHandle,
3304  sdbCursorHandle *cursor ) ;
3305 
3306 
3328 SDB_EXPORT INT32 sdbListLobPieces1( sdbCollectionHandle cHandle,
3329  bson *condition,
3330  bson *selected,
3331  bson *orderBy,
3332  bson *hint,
3333  INT64 numToSkip,
3334  INT64 numToReturn,
3335  sdbCursorHandle *cursor ) ;
3336 
3343 SDB_EXPORT INT32 sdbGetRunTimeDetail( sdbLobHandle lobHandle,
3344  bson *detail) ;
3345 
3346 
3356 SDB_EXPORT INT32 sdbReelect( sdbReplicaGroupHandle cHandle,
3357  const bson *options ) ;
3358 
3366 SDB_EXPORT INT32 sdbForceStepUp( sdbConnectionHandle cHandle,
3367  const bson *options ) ;
3368 
3377 SDB_EXPORT INT32 sdbTruncateCollection( sdbConnectionHandle cHandle,
3378  const CHAR *fullName ) ;
3379 
3399 SDB_EXPORT INT32 sdbDetachNode( sdbReplicaGroupHandle cHandle,
3400  const CHAR *hostName,
3401  const CHAR *serviceName,
3402  const bson *options ) ;
3403 
3421 SDB_EXPORT INT32 sdbAttachNode( sdbReplicaGroupHandle cHandle,
3422  const CHAR *hostName,
3423  const CHAR *serviceName,
3424  const bson *options ) ;
3425 
3436 SDB_EXPORT INT32 sdbCreateIdIndex( sdbCollectionHandle cHandle,
3437  const bson *args ) ;
3438 
3446 SDB_EXPORT INT32 sdbDropIdIndex( sdbCollectionHandle cHandle ) ;
3447 
3460 SDB_EXPORT INT32 sdbEnableSharding ( sdbCollectionHandle cHandle,
3461  const bson * args ) ;
3462 
3469 SDB_EXPORT INT32 sdbDisableSharding ( sdbCollectionHandle cHandle ) ;
3470 
3480 SDB_EXPORT INT32 sdbEnableCompression ( sdbCollectionHandle cHandle,
3481  const bson * args ) ;
3482 
3489 SDB_EXPORT INT32 sdbDisableCompression ( sdbCollectionHandle cHandle ) ;
3490 
3508 SDB_EXPORT INT32 sdbCreateAutoIncrement( sdbCollectionHandle cHandle,
3509  const bson * options ) ;
3510 
3520 SDB_EXPORT INT32 sdbDropAutoIncrement( sdbCollectionHandle cHandle,
3521  const bson * options ) ;
3522 
3543 SDB_EXPORT INT32 sdbCLSetAttributes ( sdbCollectionHandle cHandle,
3544  const bson *options ) ;
3545 
3554 SDB_EXPORT INT32 sdbCLGetDetail ( sdbCollectionHandle cHandle,
3555  sdbCursorHandle *handle ) ;
3556 
3567 SDB_EXPORT INT32 sdbCLGetIndexStat( sdbCollectionHandle cHandle,
3568  const CHAR *pIndexName,
3569  bson *result ) ;
3570 
3583 SDB_EXPORT INT32 sdbCLGetIndexStat1( sdbCollectionHandle cHandle,
3584  const CHAR *pIndexName,
3585  bson *result,
3586  BOOLEAN detail ) ;
3587 
3588 /* \fn INT32 sdbPop( sdbCollectionHandle cHandle, bson *options )
3589  \brief pop records from capped collection
3590  \param [in] cHandle The handle of connection
3591  \param [in] fullName The full name of collection to be popped, eg: foo.bar
3592  \param [in] options Pop target and direction, including "LogicalID" and "Direction".
3593  Direction is optional. Its default value is 1.
3594  e.g. { LogicalID:100, Direction:1 }
3595  \retval SDB_OK Operation Success
3596  \retval Others Operation Fail
3597 */
3598 SDB_EXPORT INT32 sdbPop( sdbCollectionHandle cHandle, bson *options ) ;
3599 
3600 /* \fn INT32 sdbGetDCName( sdbDCHandle cHandle, CHAR *pBuffer, INT32 size )
3601  \brief Get the name of the data center
3602  \param [in] cHandle The data center handle
3603  \param [in] pBuffer The output buffer
3604  \param [in] size The size of the output buffer
3605  \retval SDB_OK Operation Success
3606  \retval Others Operation Fail
3607 */
3608 SDB_EXPORT INT32 sdbGetDCName( sdbDCHandle cHandle, CHAR *pBuffer, INT32 size ) ;
3609 
3610 /* \fn INT32 sdbGetDC( sdbConnectionHandle cHandle, sdbDCHandle *handle )
3611  \brief Get the data center
3612  \param [in] cHandle The connection handle
3613  \param [out] handle The data center handle
3614  \retval SDB_OK Operation Success
3615  \retval Others Operation Fail
3616 */
3617 SDB_EXPORT INT32 sdbGetDC( sdbConnectionHandle cHandle, sdbDCHandle *handle ) ;
3618 
3619 /* \fn INT32 sdbGetDCDetail( sdbDCHandle cHandle, bson *retInfo )
3620  \brief Get the detail of data center
3621  \param [in] cHandle The connection handle
3622  \param [out] retInfo The the detail of data center
3623  \retval SDB_OK Operation Success
3624  \retval Others Operation Fail
3625 */
3626 SDB_EXPORT INT32 sdbGetDCDetail( sdbDCHandle cHandle, bson *retInfo ) ;
3627 
3628 /* \fn INT32 sdbActivateDC( sdbDCHandle cHandle )
3629  \brief Activate the data center
3630  \param [in] cHandle The data center handle
3631  \retval SDB_OK Operation Success
3632  \retval Others Operation Fail
3633 */
3634 SDB_EXPORT INT32 sdbActivateDC( sdbDCHandle cHandle ) ;
3635 
3636 /* \fn INT32 sdbDeactivateDC( sdbDCHandle cHandle )
3637  \brief Deactivate the data center
3638  \param [in] cHandle The data center handle
3639  \retval SDB_OK Operation Success
3640  \retval Others Operation Fail
3641 */
3642 SDB_EXPORT INT32 sdbDeactivateDC( sdbDCHandle cHandle ) ;
3643 
3644 /* \fn INT32 sdbEnableReadOnly( sdbDCHandle cHandle, BOOLEAN isReadOnly )
3645  \brief Enable data center works in readonly mode or not
3646  \param [in] cHandle The data center handle
3647  \param [in] isReadOnly Whether to use readonly mode or not
3648  \retval SDB_OK Operation Success
3649  \retval Others Operation Fail
3650 */
3651 SDB_EXPORT INT32 sdbEnableReadOnly( sdbDCHandle cHandle, BOOLEAN isReadOnly ) ;
3652 
3653 /* \fn INT32 sdbCreateImage( sdbDCHandle cHandle, const CHAR *pCataAddrList )
3654  \brief Create image in data center
3655  \param [in] cHandle The data center handle
3656  \param [in] pCataAddrList Catalog address list of remote data center, e.g. "192.168.20.165:30003",
3657  "192.168.20.165:30003,192.168.20.166:30003"
3658  \retval SDB_OK Operation Success
3659  \retval Others Operation Fail
3660 */
3661 SDB_EXPORT INT32 sdbCreateImage( sdbDCHandle cHandle, const CHAR *pCataAddrList ) ;
3662 
3663 /* \fn INT32 sdbRemoveImage( sdbDCHandle cHandle )
3664  \brief Remove image in data center
3665  \param [in] cHandle The data center handle
3666  \retval SDB_OK Operation Success
3667  \retval Others Operation Fail
3668 */
3669 SDB_EXPORT INT32 sdbRemoveImage( sdbDCHandle cHandle ) ;
3670 
3671 /* \fn INT32 sdbEnableImage( sdbDCHandle cHandle )
3672  \brief Enable image in data center
3673  \param [in] cHandle The data center handle
3674  \retval SDB_OK Operation Success
3675  \retval Others Operation Fail
3676 */
3677 SDB_EXPORT INT32 sdbEnableImage( sdbDCHandle cHandle ) ;
3678 
3679 /* \fn INT32 sdbDisableImage( sdbDCHandle cHandle )
3680  \brief Disable image in data center
3681  \param [in] cHandle The data center handle
3682  \retval SDB_OK Operation Success
3683  \retval Others Operation Fail
3684 */
3685 SDB_EXPORT INT32 sdbDisableImage( sdbDCHandle cHandle ) ;
3686 
3687 /* \fn INT32 sdbAttachGroups( sdbDCHandle cHandle, bson *info )
3688  \brief Attach specified groups to data center
3689  \param [in] cHandle The data center handle
3690  \param [in] info The information of groups to attach, e.g. {Groups:[["group1", "group1"], ["group2", "group2"]]}
3691  \code
3692  bson obj ;
3693  bson_init( &obj ) ;
3694  bson_append_start_array( &obj, "Groups" ) ;
3695 
3696  bson_append_start_array( &obj, "0" ) ;
3697  bson_append_string( &obj, "0", "group1" ) ;
3698  bson_append_string( &obj, "1", "group1" ) ;
3699  bson_append_finish_array( &obj ) ;
3700 
3701  bson_append_start_array( &obj, "0" ) ;
3702  bson_append_string( &obj, "0", "group2" ) ;
3703  bson_append_string( &obj, "1", "group2" ) ;
3704  bson_append_finish_array( &obj ) ;
3705 
3706  bson_append_finish_array( &obj ) ;
3707 
3708  rc = bson_finish( &obj ) ;
3709  ASSERT_EQ( SDB_OK, rc ) ;
3710 
3711  rc = sdbAttachGroups( dc, &obj ) ;
3712  ASSERT_EQ( SDB_OK, rc ) ;
3713 
3714  bson_destroy( &obj ) ;
3715  \endcode
3716  \retval SDB_OK Operation Success
3717  \retval Others Operation Fail
3718 */
3719 SDB_EXPORT INT32 sdbAttachGroups( sdbDCHandle cHandle, bson *info ) ;
3720 
3721 /* \fn INT32 sdbDetachGroups( sdbDCHandle cHandle, bson *info )
3722  \brief Detach specified groups from data center
3723  \param [in] cHandle The data center handle
3724  \param [in] info The information of groups to detach, e.g. {Groups:[["a", "a"], ["b", "b"]]}
3725  \retval SDB_OK Operation Success
3726  \retval Others Operation Fail
3727 */
3728 SDB_EXPORT INT32 sdbDetachGroups( sdbDCHandle cHandle, bson *info ) ;
3729 
3753 SDB_EXPORT INT32 sdbSyncDB( sdbConnectionHandle cHandle,
3754  bson *options ) ;
3755 
3772 SDB_EXPORT INT32 sdbLoadCollectionSpace( sdbConnectionHandle cHandle,
3773  const CHAR *csName,
3774  bson *options ) ;
3775 
3792 SDB_EXPORT INT32 sdbUnloadCollectionSpace( sdbConnectionHandle cHandle,
3793  const CHAR *csName,
3794  bson *options ) ;
3795 
3812 SDB_EXPORT INT32 sdbSetPDLevel( sdbConnectionHandle cHandle,
3813  INT32 pdLevel,
3814  bson *options ) ;
3815 
3830 SDB_EXPORT INT32 sdbReloadConfig( sdbConnectionHandle cHandle,
3831  bson *options ) ;
3832 
3848 SDB_EXPORT INT32 sdbUpdateConfig( sdbConnectionHandle cHandle,
3849  bson *configs, bson *options ) ;
3850 
3866 SDB_EXPORT INT32 sdbDeleteConfig( sdbConnectionHandle cHandle,
3867  bson *configs, bson *options ) ;
3868 
3881 SDB_EXPORT INT32 sdbRenameCollectionSpace( sdbConnectionHandle cHandle,
3882  const CHAR *pOldName,
3883  const CHAR *pNewName,
3884  bson *options ) ;
3885 
3893 SDB_EXPORT void sdbSetConnectionInterruptFunc(
3894  sdbConnectionHandle cHandle,
3895  socketInterruptFunc func ) ;
3896 
3924 SDB_EXPORT INT32 sdbAnalyze( sdbConnectionHandle cHandle,
3925  bson *options ) ;
3926 
3939 SDB_EXPORT INT32 sdbGetLastErrorObj( sdbConnectionHandle cHandle, bson *errObj ) ;
3940 
3945 SDB_EXPORT void sdbCleanLastErrorObj( sdbConnectionHandle cHandle ) ;
3946 
3970 SDB_EXPORT INT32 sdbCreateSequence( sdbConnectionHandle cHandle,
3971  const CHAR *pSequenceName,
3972  const bson *options,
3973  sdbSequenceHandle *sHandle ) ;
3974 
3985 SDB_EXPORT INT32 sdbGetSequence( sdbConnectionHandle cHandle,
3986  const CHAR *pSequenceName,
3987  sdbSequenceHandle *sHandle ) ;
3988 
3999 SDB_EXPORT INT32 sdbRenameSequence( sdbConnectionHandle cHandle,
4000  const CHAR *pOldName,
4001  const CHAR *pNewName ) ;
4002 
4011 SDB_EXPORT INT32 sdbDropSequence( sdbConnectionHandle cHandle,
4012  const CHAR *pSequenceName ) ;
4013 
4018 SDB_EXPORT void sdbReleaseSequence( sdbSequenceHandle sHandle ) ;
4019 
4038 SDB_EXPORT INT32 sdbSeqSetAttributes( sdbSequenceHandle sHandle,
4039  const bson *options ) ;
4040 
4048 SDB_EXPORT INT32 sdbSeqGetNextValue( sdbSequenceHandle sHandle, INT64 *value ) ;
4049 
4057 SDB_EXPORT INT32 sdbSeqGetCurrentValue( sdbSequenceHandle sHandle,
4058  INT64 *value ) ;
4059 
4068 SDB_EXPORT INT32 sdbSeqSetCurrentValue( sdbSequenceHandle sHandle,
4069  const INT64 value ) ;
4070 
4085 SDB_EXPORT INT32 sdbSeqFetch( sdbSequenceHandle sHandle,
4086  const INT32 fetchNum,
4087  INT64 *nextValue,
4088  INT32 *returnNum,
4089  INT32 *increment ) ;
4090 
4098 SDB_EXPORT INT32 sdbSeqRestart( sdbSequenceHandle sHandle,
4099  const INT64 startValue ) ;
4100 
4101 SDB_EXTERN_C_END
4102 #endif