InfiniSQL  v0.1.2-alpha
Massive Scale Transaction Processing
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
infinisql.h File Reference

API for creating stored procedures. Pg objects also inherit from this class, because they perform the same types of transactional activities as a stored procedure. More...

#include <stdint.h>
#include <boost/unordered_map.hpp>
#include <vector>
#include <string>
#include <msgpack.hpp>
Include dependency graph for infinisql.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uuRecord_s
 universally unique Record More...
 
struct  returnRow_s
 row and metadata for being returned to client from SELECT or stored proc More...
 
struct  fieldtypename_s
 name and type of field More...
 
union  fieldInput_u
 contents of a field (other than CHARX or VARCHAR) More...
 
struct  fieldValue_s
 field contents More...
 
struct  procedureResponse_s
 orphan? More...
 
class  ApiInterface
 Stored procedure API. More...
 
struct  ApiInterface::results_s
 results from SQL query More...
 

Macros

#define STATUS_OK   0
 
#define STATUS_NOTOK   1
 
#define APISTATUS_OK   0
 
#define APISTATUS_NOTOK   1
 
#define APISTATUS_NULLCONSTRAINT   2
 
#define APISTATUS_PENDING   3
 
#define APISTATUS_FIELD   4
 
#define APISTATUS_STATE   5
 
#define APISTATUS_UNIQUECONSTRAINT   6
 
#define APISTATUS_FOUND   7
 
#define APISTATUS_DEADLOCK   8
 
#define APISTATUS_LOCK   9
 

Typedefs

typedef union fieldInput_u fieldInput_s
 contents of a field (other than CHARX or VARCHAR) More...
 
typedef void(ApiInterface::* apifPtr )(int64_t, void *)
 
typedef ApiInterface *(* spclasscreate )(class TransactionAgent *, class ApiInterface *, void *)
 
typedef void(* spclassdestroy )(ApiInterface *)
 
typedef ApiInterfacecreate_t ()
 
typedef void destroy_t (ApiInterface *)
 

Enumerations

enum  cmd_e {
  CMD_NONE = 0, CMD_SELECT, CMD_INSERT, CMD_UPDATE,
  CMD_DELETE, CMD_BEGIN, CMD_COMMIT, CMD_ROLLBACK,
  CMD_SET, CMD_STOREDPROCEDURE
}
 type of SQL command More...
 
enum  locktype_e {
  NOTFOUNDLOCK = -1, NOLOCK = 0, READLOCK, WRITELOCK,
  PENDINGLOCK, INDEXLOCK, INDEXPENDINGLOCK, PENDINGTOWRITELOCK,
  PENDINGTOREADLOCK, PENDINGTONOLOCK, PENDINGTOINDEXLOCK, PENDINGTOINDEXNOLOCK
}
 possible lock states More...
 
enum  operatortypes_e {
  OPERATOR_NONE = 0, OPERATOR_CONCATENATION = 1, OPERATOR_ADDITION = 2, OPERATOR_SUBTRACTION = 3,
  OPERATOR_MULTIPLICATION = 4, OPERATOR_DIVISION = 5, OPERATOR_NEGATION = 7, OPERATOR_AND = 8,
  OPERATOR_OR = 9, OPERATOR_NOT = 10, OPERATOR_TRUE = 11, OPERATOR_FALSE = 12,
  OPERATOR_UNKNOWN = 13, OPERATOR_EQ = 14, OPERATOR_NE = 15, OPERATOR_LT = 16,
  OPERATOR_GT = 17, OPERATOR_LTE = 18, OPERATOR_GTE = 19, OPERATOR_BETWEEN = 20,
  OPERATOR_ISNULL = 21, OPERATOR_IN = 22, OPERATOR_LIKE = 23, OPERATOR_EXISTS = 24,
  OPERATOR_UNIQUE = 25, OPERATOR_BETWEENAND = 26, OPERATOR_NOTBETWEEN = 27, OPERATOR_ISNOTNULL = 28,
  OPERATOR_NOTIN = 29, OPERATOR_NOTLIKE = 30, OPERATOR_REGEX = 31, OPERATOR_SELECTALL = 32,
  OPERATOR_NULL = 33
}
 types of SQL operators More...
 
enum  fieldtype_e {
  NOFIELDTYPE = -1, INT = 0, UINT = 1, BOOL = 2,
  FLOAT = 3, CHAR = 4, CHARX = 5, VARCHAR = 6
}
 type of field More...
 

Functions

size_t hash_value (uuRecord_s const &)
 
bool operator== (uuRecord_s const &, uuRecord_s const &)
 

Detailed Description

API for creating stored procedures. Pg objects also inherit from this class, because they perform the same types of transactional activities as a stored procedure.

Author
infin.nosp@m.isql.nosp@m.@loca.nosp@m.lhos.nosp@m.t.loc.nosp@m.aldo.nosp@m.main
Date
Tue Dec 17 13:22:49 2013

Definition in file infinisql.h.

Macro Definition Documentation

#define APISTATUS_DEADLOCK   8

Definition at line 56 of file infinisql.h.

Referenced by Transaction::deadlockAbort().

#define APISTATUS_FIELD   4

Definition at line 52 of file infinisql.h.

Referenced by ApiInterface::insertRow(), and Transaction::updateRow().

#define APISTATUS_FOUND   7

Definition at line 55 of file infinisql.h.

#define APISTATUS_LOCK   9

Definition at line 57 of file infinisql.h.

Referenced by Transaction::continueSqlPredicate(), and Pg::errorStatus().

#define APISTATUS_NULLCONSTRAINT   2
#define APISTATUS_STATE   5

Definition at line 53 of file infinisql.h.

Typedef Documentation

typedef void(ApiInterface::* apifPtr)(int64_t, void *)

Definition at line 235 of file infinisql.h.

typedef ApiInterface* create_t()

Definition at line 750 of file infinisql.h.

typedef void destroy_t(ApiInterface *)

Definition at line 751 of file infinisql.h.

typedef union fieldInput_u fieldInput_s

contents of a field (other than CHARX or VARCHAR)

Returns
typedef ApiInterface*(* spclasscreate)(class TransactionAgent *, class ApiInterface *, void *)

Definition at line 745 of file infinisql.h.

typedef void(* spclassdestroy)(ApiInterface *)

Definition at line 747 of file infinisql.h.

Enumeration Type Documentation

enum cmd_e

type of SQL command

Enumerator
CMD_NONE 
CMD_SELECT 
CMD_INSERT 
CMD_UPDATE 
CMD_DELETE 
CMD_BEGIN 
CMD_COMMIT 
CMD_ROLLBACK 
CMD_SET 
CMD_STOREDPROCEDURE 

Definition at line 63 of file infinisql.h.

64 {
65  CMD_NONE = 0,
66  CMD_SELECT,
67  CMD_INSERT,
68  CMD_UPDATE,
69  CMD_DELETE,
70  CMD_BEGIN,
71  CMD_COMMIT,
73  CMD_SET,
75 };

type of field

Returns
Enumerator
NOFIELDTYPE 
INT 
UINT 
BOOL 
FLOAT 
CHAR 
CHARX 
VARCHAR 

Definition at line 170 of file infinisql.h.

171 {
172  NOFIELDTYPE = -1,
173  INT = 0,
174  UINT = 1,
175  BOOL = 2,
176  FLOAT = 3,
177  CHAR = 4,
178  CHARX = 5,
179  VARCHAR = 6
180 };
enum locktype_e

possible lock states

Enumerator
NOTFOUNDLOCK 
NOLOCK 
READLOCK 
WRITELOCK 
PENDINGLOCK 
INDEXLOCK 
INDEXPENDINGLOCK 
PENDINGTOWRITELOCK 
PENDINGTOREADLOCK 
PENDINGTONOLOCK 
PENDINGTOINDEXLOCK 
PENDINGTOINDEXNOLOCK 

Definition at line 94 of file infinisql.h.

95 {
96  NOTFOUNDLOCK = -1,
97  NOLOCK = 0,
98  READLOCK,
99  WRITELOCK,
100  PENDINGLOCK,
101  INDEXLOCK,
108  };

types of SQL operators

Enumerator
OPERATOR_NONE 
OPERATOR_CONCATENATION 
OPERATOR_ADDITION 
OPERATOR_SUBTRACTION 
OPERATOR_MULTIPLICATION 
OPERATOR_DIVISION 
OPERATOR_NEGATION 
OPERATOR_AND 
OPERATOR_OR 
OPERATOR_NOT 
OPERATOR_TRUE 
OPERATOR_FALSE 
OPERATOR_UNKNOWN 
OPERATOR_EQ 
OPERATOR_NE 
OPERATOR_LT 
OPERATOR_GT 
OPERATOR_LTE 
OPERATOR_GTE 
OPERATOR_BETWEEN 
OPERATOR_ISNULL 
OPERATOR_IN 
OPERATOR_LIKE 
OPERATOR_EXISTS 
OPERATOR_UNIQUE 
OPERATOR_BETWEENAND 
OPERATOR_NOTBETWEEN 
OPERATOR_ISNOTNULL 
OPERATOR_NOTIN 
OPERATOR_NOTLIKE 
OPERATOR_REGEX 
OPERATOR_SELECTALL 
OPERATOR_NULL 

Definition at line 114 of file infinisql.h.

115 {
116  OPERATOR_NONE = 0,
118  OPERATOR_ADDITION = 2,
121  OPERATOR_DIVISION = 5,
122  OPERATOR_NEGATION = 7,
123  OPERATOR_AND = 8,
124  OPERATOR_OR = 9,
125  OPERATOR_NOT = 10,
126  OPERATOR_TRUE = 11,
127  OPERATOR_FALSE = 12,
128  OPERATOR_UNKNOWN = 13,
129  OPERATOR_EQ = 14,
130  OPERATOR_NE = 15,
131  OPERATOR_LT = 16,
132  OPERATOR_GT = 17,
133  OPERATOR_LTE = 18,
134  OPERATOR_GTE = 19,
135  OPERATOR_BETWEEN = 20,
136  OPERATOR_ISNULL = 21,
137  OPERATOR_IN = 22,
138  OPERATOR_LIKE = 23,
139  OPERATOR_EXISTS = 24,
140  OPERATOR_UNIQUE = 25,
141  OPERATOR_BETWEENAND = 26,
142  OPERATOR_NOTBETWEEN = 27,
143  OPERATOR_ISNOTNULL = 28,
144  OPERATOR_NOTIN = 29,
145  OPERATOR_NOTLIKE = 30,
146  OPERATOR_REGEX = 31,
147  OPERATOR_SELECTALL = 32,
148  OPERATOR_NULL = 33
149  };

Function Documentation

size_t hash_value ( uuRecord_s const &  )

Definition at line 841 of file api.cc.

References uuRecord_s::engineid, uuRecord_s::rowid, and uuRecord_s::tableid.

842 {
843  std::size_t seed = 0;
844  boost::hash_combine(seed, uur.rowid);
845  boost::hash_combine(seed, uur.tableid);
846  boost::hash_combine(seed, uur.engineid);
847 
848  return seed;
849 }
bool operator== ( uuRecord_s const &  ,
uuRecord_s const &   
)

Definition at line 851 of file api.cc.

References uuRecord_s::engineid, uuRecord_s::rowid, and uuRecord_s::tableid.

852 {
853  return (uur1.rowid==uur2.rowid) && (uur1.tableid==uur2.tableid) &&
854  (uur1.engineid==uur2.engineid);
855 }