forked from joeferner/node-oracle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoracle_bindings.h
68 lines (53 loc) · 1.67 KB
/
oracle_bindings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef _oracle_binding_h_
#define _oracle_binding_h_
#include <v8.h>
#include <node.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include <occi.h>
#include "utils.h"
using namespace node;
using namespace v8;
class OracleClient : ObjectWrap {
public:
static void Init(Handle<Object> target);
static Handle<Value> New(const Arguments& args);
static Handle<Value> Connect(const Arguments& args);
static Handle<Value> ConnectSync(const Arguments& args);
static void EIO_Connect(uv_work_t* req);
static void EIO_AfterConnect(uv_work_t* req, int status);
static Handle<Value> CreateConnectionPool(const Arguments& args);
static void EIO_CreateConnectionPool(uv_work_t* req);
static void EIO_AfterCreateConnectionPool(uv_work_t* req, int status);
static Handle<Value> CreateConnectionPoolSync(const Arguments& args);
OracleClient();
~OracleClient();
private:
static Persistent<FunctionTemplate> s_ct;
oracle::occi::Environment* m_environment;
// oracle::occi::StatelessConnectionPool* m_connectionPool;
};
class ConnectBaton {
public:
ConnectBaton(OracleClient* client, oracle::occi::Environment* environment, v8::Handle<v8::Function>* callback);
~ConnectBaton();
OracleClient* client;
Persistent<Function> callback;
std::string hostname;
std::string user;
std::string password;
std::string database;
std::string tns;
uint32_t port;
uint32_t minConn;
uint32_t maxConn;
uint32_t incrConn;
uint32_t timeout;
oracle::occi::StatelessConnectionPool::BusyOption busyOption;
oracle::occi::Environment* environment;
oracle::occi::StatelessConnectionPool* connectionPool;
oracle::occi::Connection* connection;
std::string* error;
};
#endif