8
8
#define LOG (msg ) printf(" %s\n " ,msg);
9
9
#define TRACE (msg ) // printf("%s\n", msg);
10
10
11
+ #if PG_VERSION_NUM > 90000
12
+ #define ESCAPE_SUPPORTED
13
+ #endif
11
14
12
15
#define THROW (msg ) return ThrowException(Exception::Error(String::New(msg)));
13
16
@@ -67,8 +70,10 @@ class Connection : public ObjectWrap {
67
70
command_symbol = NODE_PSYMBOL (" command" );
68
71
69
72
NODE_SET_PROTOTYPE_METHOD (t, " connect" , Connect);
73
+ #ifdef ESCAPE_SUPPORTED
70
74
NODE_SET_PROTOTYPE_METHOD (t, " escapeIdentifier" , EscapeIdentifier);
71
75
NODE_SET_PROTOTYPE_METHOD (t, " escapeLiteral" , EscapeLiteral);
76
+ #endif
72
77
NODE_SET_PROTOTYPE_METHOD (t, " _sendQuery" , SendQuery);
73
78
NODE_SET_PROTOTYPE_METHOD (t, " _sendQueryWithParams" , SendQueryWithParams);
74
79
NODE_SET_PROTOTYPE_METHOD (t, " _sendPrepare" , SendPrepare);
@@ -132,6 +137,7 @@ class Connection : public ObjectWrap {
132
137
return Undefined ();
133
138
}
134
139
140
+ #ifdef ESCAPE_SUPPORTED
135
141
// v8 entry point into Connection#escapeIdentifier
136
142
static Handle <Value>
137
143
EscapeIdentifier (const Arguments& args)
@@ -183,6 +189,7 @@ class Connection : public ObjectWrap {
183
189
184
190
return scope.Close (jsStr);
185
191
}
192
+ #endif
186
193
187
194
// v8 entry point into Connection#_sendQuery
188
195
static Handle <Value>
@@ -361,6 +368,7 @@ class Connection : public ObjectWrap {
361
368
return args.This ();
362
369
}
363
370
371
+ #ifdef ESCAPE_SUPPORTED
364
372
char * EscapeIdentifier (const char *str)
365
373
{
366
374
TRACE (" js::EscapeIdentifier" )
@@ -372,6 +380,7 @@ class Connection : public ObjectWrap {
372
380
TRACE (" js::EscapeLiteral" )
373
381
return PQescapeLiteral (connection_, str, strlen (str));
374
382
}
383
+ #endif
375
384
376
385
int Send (const char *queryText)
377
386
{
0 commit comments