TLDR: App that parses and extracts table and column name info from SQL queries
This project has an api and application to extracts table and column info from SQL queries.
It uses the excellent sql-metadata library under the hood.
Application: https://sql-app.infocruncher.com/
Api: https://sql-api.infocruncher.com/
The /client
folder is a Terraform managed S3 website app hosted at sql-app.infocruncher.com that uses the api endpoint.
See /client/Makefile
for more information around deploying the app to AWS.
The project root is an AWS SAM managed API sql-api.infocruncher.com consisting of an API Gateway with Lambda backend.
The actual app that is deployed to Lambda is Dockerised and can be found in /app
See /Makefile
for more information around deploying the api to AWS.
Example Api response given a POST request with SELECT test as alias_test, id FROM foo, bar LIMIT 100
:
{
"query": "SELECT test as alias_test, id FROM foo, bar LIMIT 100",
"result": {
"table_names": [
"foo",
"bar"
],
"column_names": [
"test",
"id"
],
"column_aliases": [
"alias_test"
],
"limit_offset": [
100,
0
],
"values": null,
"subqueries_names": []
},
"handler_time": "0:00:00.001822",
"runtime_time": "0:01:28.981600",
"version": "1.0.0"
}