Skip to content

Commit

Permalink
types with tests (and workflow)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyramation committed Mar 30, 2024
1 parent ad462ea commit d0ab34c
Show file tree
Hide file tree
Showing 35 changed files with 20,315 additions and 666 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@ jobs:
POSTGRES_PASSWORD: password
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432

- name: enums
run: cd ./packages/enums && yarn test

- name: types
run: cd ./packages/types && yarn test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Our latest is built with `13-latest` branch from libpg_query

## Related

* [libpg-query-node](https://github.com/pyramation/libpg-query-node)
* [libpg-query-node](https://github.com/launchql/libpg-query-node)
* [libpg_query](https://github.com/pganalyze/libpg_query)
* [pg_query](https://github.com/lfittl/pg_query)
* [pg_query.go](https://github.com/lfittl/pg_query.go)
Expand Down
2 changes: 1 addition & 1 deletion packages/deparser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Our latest is built with `13-latest` branch from libpg_query

## Related

* [libpg-query-node](https://github.com/pyramation/libpg-query-node)
* [libpg-query-node](https://github.com/launchql/libpg-query-node)
* [libpg_query](https://github.com/pganalyze/libpg_query)
* [pg_query](https://github.com/lfittl/pg_query)
* [pg_query.go](https://github.com/lfittl/pg_query.go)
Expand Down
2 changes: 1 addition & 1 deletion packages/enums/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This is a helper package for `pgsql-parser`.

## Related

* [libpg-query-node](https://github.com/pyramation/libpg-query-node)
* [libpg-query-node](https://github.com/launchql/libpg-query-node)
* [libpg_query](https://github.com/pganalyze/libpg_query)
* [pg_query](https://github.com/lfittl/pg_query)
* [pg_query.go](https://github.com/lfittl/pg_query.go)
Expand Down
4 changes: 2 additions & 2 deletions packages/enums/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"build": "npm run build:module && npm run build:main",
"buidl": "npm run build",
"buidl:clean": "npm run clean && npm run buidl",
"build:proto": "cross-env NODE_ENV=development babel-node scripts/pg-proto-parser",
"build:proto": "ts-node scripts/pg-proto-parser",
"clean": "rimraf ./types",
"prepare": "npm run build",
"lint": "eslint .",
Expand Down Expand Up @@ -66,7 +66,7 @@
"eslint-plugin-prettier": "^4.0.0",
"esprima": "4.0.1",
"jest": "^29.5.0",
"pg-proto-parser": "^1.2.0",
"pg-proto-parser": "^1.5.0",
"prettier": "^2.8.7",
"rimraf": "5.0.5",
"ts-jest": "^29.1.0",
Expand Down
34 changes: 0 additions & 34 deletions packages/enums/scripts/pg-proto-parser.js

This file was deleted.

20 changes: 20 additions & 0 deletions packages/enums/scripts/pg-proto-parser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { PgProtoParser } from 'pg-proto-parser';
import { resolve, join } from 'path';

const inFile: string = join(__dirname, '../../../pg_query.proto');
const outDir: string = resolve(join(__dirname, '../src/enums'));

const parser = new PgProtoParser(inFile, {
outDir,
includeEnums: false,
includeEnumsJSON: true,
includeEnumTypeUnion: false,
includeTypes: false,
includeUtils: false,
removeUndefinedAt0: true,
parser: {
keepCase: false
}
});

parser.write();
Loading

0 comments on commit d0ab34c

Please sign in to comment.