Пример #1
0
 def __init__(self, database_url: typing.Union[DatabaseURL, str],
              **options: typing.Any) -> None:
     self._database_url = DatabaseURL(database_url)
     self._options = options
     self._dialect = pymysql.dialect(paramstyle="pyformat")
     self._dialect.supports_native_decimal = True
     self._pool = None
Пример #2
0
 def get_query_text(self):
     query_text = str(self.get_query().statement.compile(
         dialect=pymysql.dialect(), compile_kwargs={"literal_binds": True}))
     return re.sub(
         "^SELECT.*FROM", 'SELECT * FROM', query_text,
         flags=re.DOTALL).replace(' LIKE ', '.keyword LIKE ').replace(
             '...', '`.`').replace('```', '').replace(
                 " > '",
                 ".keyword > '").replace(" >= '", ".keyword >= '").replace(
                     " < '",
                     ".keyword < '").replace(" <= '", ".keyword <= '")
Пример #3
0
 def __init__(self, database_url: typing.Union[DatabaseURL, str]) -> None:
     self._database_url = DatabaseURL(database_url)
     self._dialect = pymysql.dialect(paramstyle="pyformat")
     self._pool = None
Пример #4
0
 def __init__(self, database_url: DatabaseURL) -> None:
     self._database_url = database_url
     self._dialect = pymysql.dialect(paramstyle="pyformat")
     self._pool = None
Пример #5
0
 def get_dialect(self) -> Dialect:
     return pymysql.dialect(paramstyle="pyformat")