88#define LOG (msg ) printf(" %s\n " ,msg);
99#define TRACE (msg ) // printf("%s\n", msg);
1010
11+ #if PG_VERSION_NUM > 90000
12+ #define ESCAPE_SUPPORTED
13+ #endif
1114
1215#define THROW (msg ) return ThrowException(Exception::Error(String::New(msg)));
1316
@@ -67,8 +70,10 @@ class Connection : public ObjectWrap {
6770 command_symbol = NODE_PSYMBOL (" command" );
6871
6972 NODE_SET_PROTOTYPE_METHOD (t, " connect" , Connect);
73+ #ifdef ESCAPE_SUPPORTED
7074 NODE_SET_PROTOTYPE_METHOD (t, " escapeIdentifier" , EscapeIdentifier);
7175 NODE_SET_PROTOTYPE_METHOD (t, " escapeLiteral" , EscapeLiteral);
76+ #endif
7277 NODE_SET_PROTOTYPE_METHOD (t, " _sendQuery" , SendQuery);
7378 NODE_SET_PROTOTYPE_METHOD (t, " _sendQueryWithParams" , SendQueryWithParams);
7479 NODE_SET_PROTOTYPE_METHOD (t, " _sendPrepare" , SendPrepare);
@@ -132,6 +137,7 @@ class Connection : public ObjectWrap {
132137 return Undefined ();
133138 }
134139
140+ #ifdef ESCAPE_SUPPORTED
135141 // v8 entry point into Connection#escapeIdentifier
136142 static Handle<Value>
137143 EscapeIdentifier (const Arguments& args)
@@ -183,6 +189,7 @@ class Connection : public ObjectWrap {
183189
184190 return scope.Close (jsStr);
185191 }
192+ #endif
186193
187194 // v8 entry point into Connection#_sendQuery
188195 static Handle<Value>
@@ -361,6 +368,7 @@ class Connection : public ObjectWrap {
361368 return args.This ();
362369 }
363370
371+ #ifdef ESCAPE_SUPPORTED
364372 char * EscapeIdentifier (const char *str)
365373 {
366374 TRACE (" js::EscapeIdentifier" )
@@ -372,6 +380,7 @@ class Connection : public ObjectWrap {
372380 TRACE (" js::EscapeLiteral" )
373381 return PQescapeLiteral (connection_, str, strlen (str));
374382 }
383+ #endif
375384
376385 int Send (const char *queryText)
377386 {
0 commit comments