Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pyramation/pgsql-parser-openfaas


https://github.com/pyramation/pgsql-parser-openfaas

ast nodejs openfaas parser pgsql

Last synced: 19 days ago
JSON representation

Awesome Lists containing this project

README

        

# use pgsql parser via openfaas!

This makes a openfaas function for https://github.com/pyramation/pg-query-parser

Docker Hub: https://hub.docker.com/r/pyramation/pgsql-parser/

Example usage/test:

```sh
make test
echo "select 1" | faas-cli invoke pgsql-parser --gateway http://127.0.0.1:31112 --content-type application/sql
{"contentType":"application/json","content":[{"RawStmt":{"stmt":{"SelectStmt":{"targetList":[{"ResTarget":{"val":{"A_Const":{"val":{"Integer":{"ival":1}},"location":7}},"location":7}}],"op":0}}}}]}

make test-ast
echo '[{"RawStmt":{"stmt":{"SelectStmt":{"targetList":[{"ResTarget":{"val":{"A_Const":{"val":{"Integer":{"ival":1}},"location":7}},"location":7}}],"op":0}}}}]' | faas-cli invoke pgsql-parser --gateway http://127.0.0.1:31112 --content-type application/json
{"contentType":"text/plain","content":"SELECT 1;"}
$
```