mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
Use SQLQueryFactory for container DB
Needed to add a Filter possibility to facilitate that Created a Simple UserString class which can be used as: ```py sql_filter = SQLFilter(f"SELECT {{}} FROM table_name WHERE id = ?") cursor.execute(sql_filter) # Will execute: SELECT * FROM table_name WHERE id = ? cursor.execute(sql_filter["id", "name"]) # Will execute: SELECT id, name FROM table_name WHERE id = ? ``` Contributes to CURA-6096
This commit is contained in:
parent
4067d9d607
commit
571a051041
3 changed files with 0 additions and 9 deletions
|
@ -1,6 +1,5 @@
|
|||
from UM.Settings.SQLQueryFactory import SQLQueryFactory
|
||||
from UM.Settings.DatabaseContainerMetadataController import DatabaseMetadataContainerController
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
|
||||
|
||||
class IntentDatabaseHandler(DatabaseMetadataContainerController):
|
||||
|
@ -9,7 +8,6 @@ class IntentDatabaseHandler(DatabaseMetadataContainerController):
|
|||
def __init__(self) -> None:
|
||||
super().__init__(SQLQueryFactory(table = "intents",
|
||||
fields = {
|
||||
"id": "text",
|
||||
"name": "text",
|
||||
"quality_type": "text",
|
||||
"intent_category": "text",
|
||||
|
@ -19,4 +17,3 @@ class IntentDatabaseHandler(DatabaseMetadataContainerController):
|
|||
"version": "text",
|
||||
"setting_version": "text"
|
||||
}))
|
||||
self.container_type = InstanceContainer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue