SequoiaDB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
client.hpp File Reference

C++ Client Driver. More...

#include "core.hpp"
#include "clientDef.h"
#include "bson/bson.hpp"
#include "fromjson.hpp"
#include "spd.h"
#include <map>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  sdbclient::sdbCursor
 Database operation interfaces of cursor. More...
 
class  sdbclient::sdbCollection
 Database operation interfaces of collection. More...
 
class  sdbclient::sdbNode
 Database operation interfaces of node. This class takes the place of class "sdbReplicaNode". More...
 
class  sdbclient::sdbReplicaGroup
 Database operation interfaces of replica group. More...
 
class  sdbclient::sdbCollectionSpace
 Database operation interfaces of collection space. More...
 
class  sdbclient::sdbDomain
 Database operation interfaces of domain. More...
 
class  sdbclient::sdbLob
 Database operation interfaces of large object. More...
 
class  sdbclient::sdbSequence
 Database operation interfaces of sequence. More...
 
class  sdbclient::sdb
 Database operation interfaces of admin. More...
 

Namespaces

namespace  sdbclient
 SequoiaDB Driver for C++.
 

Macros

#define RELEASE_INNER_HANDLE(handle)
 
#define SDB_PAGESIZE_4K   4096
 
#define SDB_PAGESIZE_8K   8192
 
#define SDB_PAGESIZE_16K   16384
 
#define SDB_PAGESIZE_32K   32768
 
#define SDB_PAGESIZE_64K   65536
 
#define SDB_PAGESIZE_DEFAULT   0
 
#define FLG_INSERT_CONTONDUP   0x00000001
 
#define FLG_INSERT_RETURNNUM   0x00000002
 
#define FLG_INSERT_REPLACEONDUP   0x00000004
 
#define FLG_INSERT_RETURN_OID   0x10000000
 
#define sdbReplicaNode   sdbNode
 
#define QUERY_FORCE_HINT   0x00000080
 
#define QUERY_PARALLED   0x00000100
 
#define QUERY_WITH_RETURNDATA   0x00000200
 
#define QUERY_PREPARE_MORE   0x00004000
 
#define QUERY_KEEP_SHARDINGKEY_IN_UPDATE   0x00008000
 
#define QUERY_FOR_UPDATE   0x00010000
 
#define UPDATE_KEEP_SHARDINGKEY   QUERY_KEEP_SHARDINGKEY_IN_UPDATE
 
#define UPDATE_ONE   0x00000002
 
#define UPDATE_RETURNNUM   0x00000004
 
#define FLG_DELETE_ONE   0x00000002
 
#define FLG_DELETE_RETURNNUM   0x00000004
 

Typedefs

typedef enum _SDB_LOB_OPEN_MODE SDB_LOB_OPEN_MODE
 The open mode.
 
typedef enum _SDB_LOB_SEEK SDB_LOB_SEEK
 The whence of seek.
 
typedef void(* sdbclient::ERROR_ON_REPLY_FUNC )(const CHAR *pErrorObj, UINT32 objSize, INT32 flag, const CHAR *pDescription, const CHAR *pDetail)
 
typedef class sdb sdbclient::sdb
 Class sdb definition for sdb.
 

Enumerations

enum  _SDB_LOB_OPEN_MODE { SDB_LOB_CREATEONLY = 0x00000001, SDB_LOB_READ = 0x00000004, SDB_LOB_WRITE = 0x00000008, SDB_LOB_SHAREREAD = 0x00000040 }
 
enum  _SDB_LOB_SEEK { SDB_LOB_SEEK_SET = 0, SDB_LOB_SEEK_CUR, SDB_LOB_SEEK_END }
 
enum  sdbclient::sdbNodeStatus
 

Functions

SDB_EXPORT void sdbclient::sdbSetErrorOnReplyCallback (ERROR_ON_REPLY_FUNC func)
 Set the callback function when reply message if error from server.
 
SDB_EXPORT INT32 sdbclient::initClient (sdbClientConf *config)
 set client global configuration such as cache strategy to improve performance
 

Detailed Description

C++ Client Driver.

Macro Definition Documentation

#define FLG_DELETE_ONE   0x00000002

The flag represent whether to delete only one matched record or all matched records

#define FLG_DELETE_RETURNNUM   0x00000004

The flag represent whether update return detail result

#define FLG_INSERT_CONTONDUP   0x00000001

The flag represent whether insert continue(no errors were reported) when hitting index key duplicate error

#define FLG_INSERT_REPLACEONDUP   0x00000004

The flag represent replacing the existing record by the new record and continuing when insert hitting index key duplicate error

#define FLG_INSERT_RETURN_OID   0x10000000

The flag represent whether insert return the "_id" field of the record for user

#define FLG_INSERT_RETURNNUM   0x00000002

The flag represent whether insert return detail result

#define QUERY_FOR_UPDATE   0x00010000

When the transaction is turned on and the transaction isolation level is "RC", the transaction lock will be released after the record is read by default. However, when setting this flag, the transaction lock will not released until the transaction is committed or rollback. When the transaction is turned off or the transaction isolation level is "RU", the flag does not work.

#define QUERY_FORCE_HINT   0x00000080

Force to use specified hint to query, if database have no index assigned by the hint, fail to query.

#define QUERY_KEEP_SHARDINGKEY_IN_UPDATE   0x00008000

The sharding key in update rule is not filtered, when executing queryAndUpdate.

#define QUERY_PARALLED   0x00000100

Enable parallel sub query, each sub query will finish scanning different part of the data.

#define QUERY_PREPARE_MORE   0x00004000

Enable prepare more data when query

#define QUERY_WITH_RETURNDATA   0x00000200

In general, query won't return data until cursor gets from database, when add this flag, return data in query response, it will be more high-performance

#define RELEASE_INNER_HANDLE (   handle)
Value:
do \
{ \
if ( handle ) \
{ \
delete handle ; \
handle = NULL ; \
} \
} while( 0 )

This micro is for internal use, not a public api, it will be removed in the future

#define SDB_PAGESIZE_16K   16384

define page size to 16k

#define SDB_PAGESIZE_32K   32768

define page size to 32k

#define SDB_PAGESIZE_4K   4096

define page size to 4k

#define SDB_PAGESIZE_64K   65536

define page size to 64k

#define SDB_PAGESIZE_8K   8192

define page size to 8k

#define SDB_PAGESIZE_DEFAULT   0

0 means using database's default pagesize, it 64k now

#define sdbReplicaNode   sdbNode

class name 'sdbReplicaNode' will be deprecated in version 2.x, use 'sdbNode' instead of it.

#define UPDATE_KEEP_SHARDINGKEY   QUERY_KEEP_SHARDINGKEY_IN_UPDATE

The sharding key in update rule is not filtered, when executing update or upsert.

#define UPDATE_ONE   0x00000002

The flag represent whether to update only one matched record or all matched records

#define UPDATE_RETURNNUM   0x00000004

The flag represent whether update return detail result

Enumeration Type Documentation

Enumerator:
SDB_LOB_CREATEONLY 

Open a new lob only

SDB_LOB_READ 

Open an existing lob to read

SDB_LOB_WRITE 

Open an existing lob to write

SDB_LOB_SHAREREAD 

Open an existing lob to share read

Enumerator:
SDB_LOB_SEEK_SET 

Seek from the beginning of file

SDB_LOB_SEEK_CUR 

Seek from the current place

SDB_LOB_SEEK_END 

Seek from the end of file