Skip to content

Commit 256a76c

Browse files
authored
feat: introduce postgresql parser (#5)
* feat: introduce postgresql parser * chore: add postgresql in ci matrix * chore: add gate keeper
1 parent 2208c68 commit 256a76c

File tree

234 files changed

+304672
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+304672
-1
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
id: set-matrix
3535
run: |
3636
# List of all available parsers
37-
ALL_PARSERS="redshift"
37+
ALL_PARSERS="redshift postgresql"
3838
# Add more parsers here as they are added to the repository
3939
# ALL_PARSERS="redshift mysql postgresql"
4040
@@ -101,3 +101,15 @@ jobs:
101101
# sort: cut into columns by delimiter ' ' (single space) and sort by column 3 (test time in seconds) as numeric type in reverse order (largest comes first)
102102
# awk: accumulate sum by test time in seconds
103103
run: grep --color=never -e '--- PASS:' -e '--- FAIL:' test.log | sed 's/[:()]//g' | awk '{print $2,$3,$4}' | sort -t' ' -nk3 -r | awk '{sum += $3; print $1,$2,$3,sum"s"}'
104+
105+
all-tests-passed:
106+
runs-on: ubuntu-latest
107+
# This job needs both detect-changes and go-tests
108+
needs: [detect-changes, go-tests]
109+
# This condition is key:
110+
# - Run if no files were changed (the 'go-tests' job was skipped).
111+
# - Or run if the 'go-tests' job (the whole matrix) succeeded.
112+
if: success() || needs.detect-changes.outputs.any_changed == 'false'
113+
steps:
114+
- name: Report overall status
115+
run: echo "All required tests passed or no changes were detected."

postgresql/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
all: build test
2+
3+
build:
4+
antlr -Dlanguage=Go -package postgresql -visitor -o . PostgreSQLLexer.g4 PostgreSQLParser.g4
5+
6+
test:
7+
go test -v -run TestPostgreSQLParser

0 commit comments

Comments
 (0)