Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to work with Node v14 #39

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
build
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "SQL ANYWHERE",
"name": "sqlanywhere",
"description": "SQL Anywhere JavaScript Driver.",
"version": "1.0.24",
"version": "2.0.1",
"repository": {
"url": "https://github.com/sqlanywhere/node-sqlanywhere"
},
Expand All @@ -15,6 +15,6 @@
},
"dependencies": {
"help": "^3.0.2",
"nan": "2.11.1"
"nan": "^2.14.0"
}
}
8 changes: 0 additions & 8 deletions src/h/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,14 @@ class Connection : public ObjectWrap
{
public:
/// @internal
#if v010
static void Init();
#else
static void Init( Isolate * );
#endif

/// @internal
static NODE_API_FUNC( NewInstance );

private:
/// @internal
#if v010
Connection( const Arguments &args );
#else
Connection( const FunctionCallbackInfo<Value> &args );
#endif
/// @internal
~Connection();

Expand Down
15 changes: 0 additions & 15 deletions src/h/nodever_cover.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,4 @@
// ***************************************************************************
#include <node_version.h>

#if NODE_MAJOR_VERSION == 0 && NODE_MINOR_VERSION == 10
#define v010 1
#define v012 0
#elif NODE_MAJOR_VERSION == 0 && NODE_MINOR_VERSION == 12
#define v010 0
#define v012 1
#else
#define v010 0
#define v012 0
#endif

#if v010
#define NODE_API_FUNC( name ) Handle<Value> name ( const Arguments &args )
#else
#define NODE_API_FUNC( name ) void name ( const FunctionCallbackInfo<Value> &args )
#endif
22 changes: 2 additions & 20 deletions src/h/sqlany_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,6 @@ void getErrorMsg( int code, std::string &str );
void throwError( a_sqlany_connection *conn );
void throwError( int code );

#if v010
void callBack( std::string * str,
Persistent<Function> callback,
Local<Value> Result,
bool callback_required = true );
void callBack( std::string * str,
Local<Value> callback,
Local<Value> Result,
bool callback_required = true );
#else
void callBack( std::string * str,
Persistent<Function> & callback,
Local<Value> & Result,
Expand All @@ -154,27 +144,19 @@ void callBack( std::string * str,
Persistent<Function> & callback,
Persistent<Value> & Result,
bool callback_required = true );
#endif

bool getBindParameters( std::vector<ExecuteData *> &execData
, Handle<Value> arg
, Local<Value> arg
, std::vector<a_sqlany_bind_param> &params
, unsigned &num_rows
);

#if v010
bool getResultSet( Local<Value> &Result
, int &rows_affected
, std::vector<char *> &colNames
, ExecuteData *execData
, std::vector<a_sqlany_data_type> &col_types );
#else

bool getResultSet( Persistent<Value> &Result
, int &rows_affected
, std::vector<char *> &colNames
, ExecuteData *execData
, std::vector<a_sqlany_data_type> &col_types );
#endif

bool fetchResultSet( a_sqlany_stmt *sqlany_stmt
, int &rows_affected
Expand Down
6 changes: 0 additions & 6 deletions src/h/stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,14 @@ class StmtObject : public node::ObjectWrap
{
public:
/// @internal
#if v010
static void Init();
#else
static void Init( Isolate * );
#endif

/// @internal
static NODE_API_FUNC( NewInstance );

/// @internal
#if !v010
static void CreateNewInstance( const FunctionCallbackInfo<Value> &args,
Persistent<Object> &obj );
#endif

/// @internal
StmtObject();
Expand Down
Loading