Skip to content

Commit 3442cc6

Browse files
Merge pull request #1 from beekeeper-studio/nodev16-2
Nodev16 2
2 parents 4465ee0 + 0199b8a commit 3442cc6

File tree

13 files changed

+2706
-2575
lines changed

13 files changed

+2706
-2575
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
node_modules

package-lock.json

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
"author": "SQL ANYWHERE",
33
"name": "sqlanywhere",
44
"description": "SQL Anywhere JavaScript Driver.",
5-
"version": "1.0.27",
5+
"version": "2.0.3",
66
"repository": {
77
"url": "https://github.com/sqlanywhere/node-sqlanywhere"
88
},
99
"main": "./lib/index",
1010
"engines": {
11-
"node": ">=0.10"
11+
"node": ">=14.0.0"
1212
},
1313
"scripts": {
1414
"install": "node build.js"
1515
},
1616
"dependencies": {
1717
"help": "^3.0.2",
18-
"nan": "2.14.2"
18+
"nan": "^2.15.0"
1919
}
2020
}

src/h/connection.h

Lines changed: 38 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -136,38 +136,30 @@ using namespace node;
136136
*/
137137
class Connection : public ObjectWrap
138138
{
139-
public:
139+
public:
140140
/// @internal
141-
#if v010
142-
static void Init();
143-
#else
144-
static void Init( Isolate * );
145-
#endif
141+
static void Init(Isolate *);
146142

147143
/// @internal
148-
static NODE_API_FUNC( NewInstance );
149-
150-
private:
144+
static NODE_API_FUNC(NewInstance);
145+
146+
private:
151147
/// @internal
152-
#if v010
153-
Connection( const Arguments &args );
154-
#else
155-
Connection( const FunctionCallbackInfo<Value> &args );
156-
#endif
148+
Connection(const FunctionCallbackInfo<Value> &args);
157149
/// @internal
158150
~Connection();
159151

160152
/// @internal
161153
static Persistent<Function> constructor;
162154

163155
/// @internal
164-
static void noParamAfter( uv_work_t *req );
156+
static void noParamAfter(uv_work_t *req);
165157
/// @internal
166-
static void connectAfter( uv_work_t *req );
158+
static void connectAfter(uv_work_t *req);
167159
/// @internal
168-
static void connectWork( uv_work_t *req );
160+
static void connectWork(uv_work_t *req);
169161
/// @internal
170-
static NODE_API_FUNC( New );
162+
static NODE_API_FUNC(New);
171163

172164
/// Connect using an existing connection.
173165
//
@@ -202,7 +194,7 @@ class Connection : public ObjectWrap
202194
//
203195
// @internal
204196
///
205-
197+
206198
/** Creates a new connection.
207199
*
208200
* This method creates a new connection using either a connection string
@@ -242,7 +234,7 @@ class Connection : public ObjectWrap
242234
*
243235
* @see Connection::disconnect
244236
*/
245-
static NODE_API_FUNC( connect );
237+
static NODE_API_FUNC(connect);
246238

247239
/** Closes the current connection.
248240
*
@@ -275,11 +267,11 @@ class Connection : public ObjectWrap
275267
*
276268
* @see Connection::connect
277269
*/
278-
static NODE_API_FUNC( disconnect );
279-
270+
static NODE_API_FUNC(disconnect);
271+
280272
/// @internal
281-
static void disconnectWork( uv_work_t *req );
282-
273+
static void disconnectWork(uv_work_t *req);
274+
283275
/** Executes the specified SQL statement.
284276
*
285277
* This method takes in a SQL statement and an optional array of bind
@@ -335,8 +327,8 @@ class Connection : public ObjectWrap
335327
* @return If no callback is specified, the result is returned.
336328
*
337329
*/
338-
static NODE_API_FUNC( exec );
339-
330+
static NODE_API_FUNC(exec);
331+
340332
/** Prepares the specified SQL statement.
341333
*
342334
* This method prepares a SQL statement and returns a Statement object
@@ -373,13 +365,13 @@ class Connection : public ObjectWrap
373365
* @return If no callback is specified, a Statement object is returned.
374366
*
375367
*/
376-
static NODE_API_FUNC( prepare );
377-
368+
static NODE_API_FUNC(prepare);
369+
378370
/// @internal
379-
static void prepareAfter( uv_work_t *req );
371+
static void prepareAfter(uv_work_t *req);
380372
/// @internal
381-
static void prepareWork( uv_work_t *req );
382-
373+
static void prepareWork(uv_work_t *req);
374+
383375
/** Performs a commit on the connection.
384376
*
385377
* This method performs a commit on the connection.
@@ -421,11 +413,11 @@ class Connection : public ObjectWrap
421413
* @param callback The optional callback function. ( type: Function )
422414
*
423415
*/
424-
static NODE_API_FUNC( commit );
416+
static NODE_API_FUNC(commit);
425417

426418
/// @internal
427-
static void commitWork( uv_work_t *req );
428-
419+
static void commitWork(uv_work_t *req);
420+
429421
/** Performs a rollback on the connection.
430422
*
431423
* This method performs a rollback on the connection.
@@ -465,10 +457,10 @@ class Connection : public ObjectWrap
465457
* @param callback The optional callback function. ( type: Function )
466458
*
467459
*/
468-
static NODE_API_FUNC( rollback );
460+
static NODE_API_FUNC(rollback);
469461

470462
/// @internal
471-
static void rollbackWork( uv_work_t *req );
463+
static void rollbackWork(uv_work_t *req);
472464

473465
/** Indicates whether the connection is connected.
474466
*
@@ -492,24 +484,24 @@ class Connection : public ObjectWrap
492484
* @return true if the connection is connected, false if not.
493485
*
494486
*/
495-
static NODE_API_FUNC( connected );
487+
static NODE_API_FUNC(connected);
496488

497-
public:
489+
public:
498490
/// @internal
499-
a_sqlany_connection *conn;
491+
a_sqlany_connection *conn;
500492
/// @internal
501-
unsigned int max_api_ver;
493+
unsigned int max_api_ver;
502494
/// @internal
503-
bool sqlca_connection;
495+
bool sqlca_connection;
504496
/// @internal
505-
uv_mutex_t conn_mutex;
497+
uv_mutex_t conn_mutex;
506498
/// @internal
507-
Persistent<String> _arg;
499+
Persistent<String> _arg;
508500
/// @internal
509-
std::vector<void*> statements;
501+
std::vector<void *> statements;
510502

511503
/// @internal
512-
void removeStmt( class StmtObject *stmt );
504+
void removeStmt(class StmtObject *stmt);
513505
/// @internal
514-
void cleanupStmts( void );
506+
void cleanupStmts(void);
515507
};

src/h/errors.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// ***************************************************************************
22
// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved.
33
// ***************************************************************************
4-
#define JS_ERR_INVALID_OBJECT -2001
5-
#define JS_ERR_INVALID_ARGUMENTS -2002
6-
#define JS_ERR_CONNECTION_ALREADY_EXISTS -2003
7-
#define JS_ERR_INITIALIZING_DBCAPI -2004
8-
#define JS_ERR_NOT_CONNECTED -2005
9-
#define JS_ERR_BINDING_PARAMETERS -2006
10-
#define JS_ERR_GENERAL_ERROR -2007
11-
#define JS_ERR_RESULTSET -2008
12-
#define JS_ERR_NO_WIDE_STATEMENTS -2009
4+
#define JS_ERR_INVALID_OBJECT -2001
5+
#define JS_ERR_INVALID_ARGUMENTS -2002
6+
#define JS_ERR_CONNECTION_ALREADY_EXISTS -2003
7+
#define JS_ERR_INITIALIZING_DBCAPI -2004
8+
#define JS_ERR_NOT_CONNECTED -2005
9+
#define JS_ERR_BINDING_PARAMETERS -2006
10+
#define JS_ERR_GENERAL_ERROR -2007
11+
#define JS_ERR_RESULTSET -2008
12+
#define JS_ERR_NO_WIDE_STATEMENTS -2009

src/h/nodever_cover.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,4 @@
33
// ***************************************************************************
44
#include <node_version.h>
55

6-
#if NODE_MAJOR_VERSION == 0 && NODE_MINOR_VERSION == 10
7-
#define v010 1
8-
#define v012 0
9-
#elif NODE_MAJOR_VERSION == 0 && NODE_MINOR_VERSION == 12
10-
#define v010 0
11-
#define v012 1
12-
#else
13-
#define v010 0
14-
#define v012 0
15-
#endif
16-
17-
#if v010
18-
#define NODE_API_FUNC( name ) Handle<Value> name ( const Arguments &args )
19-
#else
20-
#define NODE_API_FUNC( name ) void name ( const FunctionCallbackInfo<Value> &args )
21-
#endif
6+
#define NODE_API_FUNC(name) void name(const FunctionCallbackInfo<Value> &args)

0 commit comments

Comments
 (0)