mirror of
https://github.com/apache/superset.git
synced 2026-04-22 09:35:23 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user