|
|
|
@ -31,8 +31,8 @@ log = logging.getLogger(__file__)
|
|
|
|
|
class SqlType: |
|
|
|
|
"""SQL type, for now it just contain `SELECT` and `NO_SELECT`.""" |
|
|
|
|
|
|
|
|
|
SELECT = 0 |
|
|
|
|
NOT_SELECT = 1 |
|
|
|
|
SELECT = "0" |
|
|
|
|
NOT_SELECT = "1" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Sql(Task): |
|
|
|
@ -64,7 +64,7 @@ class Sql(Task):
|
|
|
|
|
name: str, |
|
|
|
|
datasource_name: str, |
|
|
|
|
sql: str, |
|
|
|
|
sql_type: Optional[int] = None, |
|
|
|
|
sql_type: Optional[str] = None, |
|
|
|
|
pre_statements: Optional[str] = None, |
|
|
|
|
post_statements: Optional[str] = None, |
|
|
|
|
display_rows: Optional[int] = 10, |
|
|
|
@ -80,7 +80,7 @@ class Sql(Task):
|
|
|
|
|
self.display_rows = display_rows |
|
|
|
|
|
|
|
|
|
@property |
|
|
|
|
def sql_type(self) -> int: |
|
|
|
|
def sql_type(self) -> str: |
|
|
|
|
"""Judgement sql type, it will return the SQL type for type `SELECT` or `NOT_SELECT`. |
|
|
|
|
|
|
|
|
|
If `param_sql_type` dot not specific, will use regexp to check |
|
|
|
|