feat: add Postgres SQL validator (#11538)

* Add Postgres SQL validator

* Strip line number from message

* Add unit tests

* Run tests only with postgres backend

* Add dep

* Add dep to bashlib
This commit is contained in:
Beto Dealmeida
2020-12-04 19:17:23 -08:00
committed by GitHub
parent 2c323426d1
commit 66cd565bff
13 changed files with 132 additions and 40 deletions

View File

@@ -16,9 +16,12 @@
# under the License.
from typing import Optional, Type
from . import base, presto_db
from . import base, postgres, presto_db
from .base import SQLValidationAnnotation
def get_validator_by_name(name: str) -> Optional[Type[base.BaseSQLValidator]]:
return {"PrestoDBSQLValidator": presto_db.PrestoDBSQLValidator}.get(name)
return {
"PrestoDBSQLValidator": presto_db.PrestoDBSQLValidator,
"PostgreSQLValidator": postgres.PostgreSQLValidator,
}.get(name)