graphql-engine/scripts
Shahidh K Muhammed 42a25f044e
add script and now.sh function to edit pg_dump output (close #1861) (#1884)
<!-- Thank you for submitting this PR! :) -->
<!-- Provide a general summary of your changes in the Title above ^, end with (close #<issue-no>) or (fix #<issue-no>) -->

### Description
<!-- The title might not be enough to convey how this change affects the user. -->
<!-- Describe the changes from a user's perspective -->
This PR adds a bash script and a serverless function to clean up the output of `pg_dump` so that it can be used as a migration file for Hasura. This can be later integrated with the CLI so that the cleanup is handled by CLI.

### Affected components 
<!-- Remove non-affected components from the list -->

- Scripts

### Related Issues
<!-- Please make sure you have an issue associated with this Pull Request -->
<!-- And then add `(close #<issue-no>)` to the pull request title -->
<!-- Add the issue number below (e.g. #234) -->
#1861 
### Solution and Design
<!-- How is this issue solved/fixed? What is the design? -->
<!-- It's better if we elaborate -->
- A serverless function written in Go gets the SQL content though HTTP POST.
- A set of pre-defined lines are removed from this SQL string.
- SQL comments are removed using regex matching.
- Postgres triggers created by Hasura for use with event triggers are removed with regex matching.
- Empty newlines are removed by regex matching.
- Resulting string is returned in the HTTP response.
### Steps to test and verify
<!-- If this is a feature, what are the steps to try them out? -->
<!-- If this is a bug-fix, how do we verify the fix? -->
```bash
curl --data-binary @filename.sql https://hasura-edit-pg-dump.now.sh > newfile.sql
```

### Limitations, known bugs & workarounds
<!-- Limitations of the PR, known bugs and suggested workarounds -->
NA
<!-- Feel free to delete these comment lines -->
2019-03-27 21:36:58 +05:30
..
cli-migrations update manifests to v1.0.0-alpha41 2019-03-26 10:33:01 +05:30
edit-pg-dump add script and now.sh function to edit pg_dump output (close #1861) (#1884) 2019-03-27 21:36:58 +05:30
generate_brand_assets_readme.sh update brand assets and the generator script (fix #670) (#712) 2018-10-13 14:01:31 +05:30
get-version-circleci.sh only deploy dev|release branches (#76) 2018-07-10 11:52:13 +00:00
get-version.sh only deploy dev|release branches (#76) 2018-07-10 11:52:13 +00:00
tag-release.sh fix tag script to handle multiple directories (#1100) 2018-11-23 18:59:22 +05:30