SequoiaDB
 All Classes Files Functions
sequoiadb.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright (C) 2012-2014 SequoiaDB Ltd.
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 *******************************************************************************/
16 
23 class SequoiaDB
24 {
25 public:
35  __construct ( string $hostName = NULL,
36  string $userName = NULL,
37  string $password = NULL ) ;
38 
43  void install ( array|string $install ) ;
44 
49  array|string getError ( void ) ;
50 
60  array|string connect ( string $hostName,
61  string $userName = NULL,
62  string $password = NULL ) ;
63 
67  void close ( void ) ;
68 
74  SequoiaCursor execSQL ( string $sql ) ;
75 
81  array|string execUpdateSQL ( string $sql ) ;
82 
104  SequoiaCursor getSnapshot ( int $snapType,
105  array|string $condition = NULL,
106  array|string $select = NULL,
107  array|string $orderBy = NULL ) ;
108 
129  SequoiaCursor getList ( int $listType,
130  array|string $condition = NULL,
131  array|string $select = NULL,
132  array|string $orderBy = NULL ) ;
133 
139  SequoiaGroup selectGroup ( string $name ) ;
140 
145  array|string resetSnapshot ( void ) ;
146 
153  SequoiadbCS selectCS ( string $name, int $pageSize = 4096 ) ;
154 
159  SequoiaCursor listCSs ( void ) ;
160 
165  SequoiaCursor listCollections ( void ) ;
166 
178  array|string createCataGroup ( string $hostname,
179  string $serviceName,
180  string $databasePath,
181  array|string $config ) ;
182 
188  array|string dropCollectionSpace ( string $name ) ;
189 
190 } ;
191 
195 class SecureSdb: public SequoiaDB
196 {
197 } ;
198 
202 {
203 public:
204 
211  SequoiaCL selectCollection ( string $name, array|string $options ) ;
212 
217  array|string drop ( void ) ;
218 
223  array|string dropCollection ( string $name ) ;
224 
229  string getName ( void ) ;
230 } ;
231 
235 {
236 public:
237 
243  array|string insert ( array|string $record ) ;
244 
255  array|string update ( array|string $rule,
256  array|string $condition = NULL,
257  array|string $hint = NULL ) ;
258 
266  array|string remove ( array|string $condition = NULL,
267  array|string $hint = NULL ) ;
268 
284  SequoiaCursor find ( array|string $condition = NULL,
285  array|string $select = NULL,
286  array|string $orderBy = NULL,
287  array|string $hint = NULL,
288  int $numToSkip = 0,
289  int $numToReturn = -1 ) ;
290 
310  SequoiaCursor findAndUpdate ( array|string $update,
311  array|string $condition = NULL,
312  array|string $select = NULL,
313  array|string $orderBy = NULL,
314  array|string $hint = NULL,
315  int $numToSkip = 0,
316  int $numToReturn = -1,
317  bool $returnNew = FALSE ) ;
318 
334  SequoiaCursor findAndRemove ( array|string $condition = NULL,
335  array|string $select = NULL,
336  array|string $orderBy = NULL,
337  array|string $hint = NULL,
338  int $numToSkip = 0,
339  int $numToReturn = -1 ) ;
340 
349  array|string split ( string $sourceName, string $destName, array|string $condition, array|string $endCondition = NULL ) ;
350 
358  array|string split ( string $sourceName, string $destName, double $percent ) ;
359 
364  array|string drop ( void ) ;
365 
371  SequoiaCursor aggregate ( array|string $aggrObj ) ;
372 
386  array|string createIndex ( array|string $indexDef,
387  string $pIndexName,
388  bool $isUnique = false,
389  bool $isEnforced = false,
390  int $sortBufferSize = 64 ) ;
391 
397  array|string deleteIndex ( string $pIndexName ) ;
398 
404  SequoiaCursor getIndex ( string $pIndexName = "" ) ;
405 
410  string getCSName ( void ) ;
411 
416  string getCollectionName ( void ) ;
417 
422  string getFullName ( void ) ;
423 
429  int count ( array|string $condition = NULL ) ;
430 
435  int truncate ( void ) ;
436 
441  int createIdIndex ( void ) ;
442 
447  int dropIdIndex ( void ) ;
448 } ;
449 
453 {
454 public:
455 
460  array|string getNext ( void ) ;
461 
466  array|string current ( void ) ;
467 
473  /*array|string updateCurrent ( array|string $rule ) ;*/
474 
479  /*array|string deleteCurrent ( void ) ;*/
480 } ;
481 
485 {
486 public:
487 
493  int getNodeNum ( int $status ) ;
494 
499  array|string getDetail ( void ) ;
500 
505  SequoiaNode getMaster ( void ) ;
506 
511  SequoiaNode getSlave ( void ) ;
512 
518  SequoiaNode getNode ( string $nodeName ) ;
519 
528  array|string createNode ( string $hostName, string $serviceName, string $databasePath, array|string $config ) ;
529 
534  array|string start ( void ) ;
535 
540  array|string stop ( void ) ;
541 
546  bool isCatalog ( void ) ;
547 };
548 
552 {
553 public:
554 
559  array|string stop ( void ) ;
560 
565  array|string start ( void ) ;
566 
571  string getNodeName ( void ) ;
572 
577  string getServiceName ( void ) ;
578 
583  string getHostName ( void ) ;
584 
589  int getStatus ( void ) ;
590 
595  SequoiaDB connect ( void ) ;
596 };
597 
598 
602 {
603 public:
609  __construct ( string $oid ) ;
610 
615  string __toString ( void ) ;
616 } ;
617 
618 
622 {
623 public:
629  __construct ( string $date ) ;
630 
635  string __toString ( void ) ;
636 } ;
637 
641 {
642 public:
648  __construct ( string $timestamp ) ;
649 
654  string __toString ( void ) ;
655 } ;
656 
660 {
661 public:
667  __construct ( string $regex ) ;
668 
673  string __toString ( void ) ;
674 } ;