feat(multisql): support passing a wildcard query
Otherwise we sometimes duplicate a query for different DBs Resolves #35768 Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
63c34a8fd8
commit
62b4700395
1 changed files with 4 additions and 1 deletions
|
|
@ -1413,8 +1413,11 @@ class Database:
|
|||
return self.is_missing_column(e) or self.is_table_missing(e)
|
||||
|
||||
def multisql(self, sql_dict, values=(), **kwargs):
|
||||
"""
|
||||
Chooses which query to execute based on the current database type, falling back to a wildcard query.
|
||||
"""
|
||||
current_dialect = self.db_type or "mariadb"
|
||||
query = sql_dict.get(current_dialect)
|
||||
query = sql_dict.get(current_dialect) or sql_dict.get("*")
|
||||
return self.sql(query, values, **kwargs)
|
||||
|
||||
def delete(self, doctype: str, filters: dict | list | None = None, debug=False, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue