Skip to content
New issue

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

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

Already on GitHub? # to your account

(DONT MERGE) 12 latest #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ node_js:
- "0.12"
- "4"
- "5"
- "10"
- "12"
addons:
apt:
sources:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl
## How to re-buid

```sh
git clone -b 10-latest git://github.com/lfittl/libpg_query
git clone -b 12-latest-develop git://github.com/lfittl/libpg_query
cd libpg_query
make
```
Expand Down
15 changes: 12 additions & 3 deletions libpg_query/include/pg_query.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ typedef struct {
char* context; // additional context (optional, can be NULL)
} PgQueryError;

typedef struct {
void* pbuf;
unsigned int pbuf_len;
char* stderr_buffer;
PgQueryError* error;
} PgQueryScanResult;

typedef struct {
char* parse_tree;
char* stderr_buffer;
Expand Down Expand Up @@ -37,20 +44,22 @@ extern "C" {
#endif

PgQueryNormalizeResult pg_query_normalize(const char* input);
PgQueryScanResult pg_query_scan(const char* input);
PgQueryParseResult pg_query_parse(const char* input);
PgQueryPlpgsqlParseResult pg_query_parse_plpgsql(const char* input);

PgQueryFingerprintResult pg_query_fingerprint(const char* input);

void pg_query_free_normalize_result(PgQueryNormalizeResult result);
void pg_query_free_scan_result(PgQueryScanResult result);
void pg_query_free_parse_result(PgQueryParseResult result);
void pg_query_free_plpgsql_parse_result(PgQueryPlpgsqlParseResult result);
void pg_query_free_fingerprint_result(PgQueryFingerprintResult result);

// Postgres version information
#define PG_VERSION "10.0"
#define PG_MAJORVERSION "10"
#define PG_VERSION_NUM 100000
#define PG_VERSION "12.3"
#define PG_MAJORVERSION "12"
#define PG_VERSION_NUM 120003

// Deprecated APIs below

Expand Down
Binary file modified libpg_query/linux/libpg_query.a
Binary file not shown.
Binary file modified libpg_query/osx/libpg_query.a
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pg-query-native",
"version": "1.1.0",
"version": "1.1.0-v12",
"description": "The real PostgreSQL query parser",
"homepage": "http://github.com/zhm/node-pg-query-native",
"main": "index.js",
Expand All @@ -10,11 +10,11 @@
"rebuild": "./node_modules/node-gyp/bin/node-gyp.js configure rebuild",
"test": "mocha"
},
"author": "Zac McCormick <zac.mccormick@gmail.com> (http://github.com/zhm)",
"author": "Dan Lynch <pyramation@gmail.com> (http://github.com/pyramation)",
"license": "BSD",
"repository": {
"type": "git",
"url": "git://github.com/zhm/node-pg-query-native.git"
"url": "git://github.com/pyramation/node-pg-query-native.git"
},
"devDependencies": {
"mocha": "^2.5.3"
Expand Down