mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00

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
19 lines
996 B
Python
19 lines
996 B
Python
from UM.Settings.SQLQueryFactory import SQLQueryFactory
|
|
from UM.Settings.DatabaseContainerMetadataController import DatabaseMetadataContainerController
|
|
|
|
|
|
class IntentDatabaseHandler(DatabaseMetadataContainerController):
|
|
"""The Database handler for Intent containers"""
|
|
|
|
def __init__(self) -> None:
|
|
super().__init__(SQLQueryFactory(table = "intents",
|
|
fields = {
|
|
"name": "text",
|
|
"quality_type": "text",
|
|
"intent_category": "text",
|
|
"variant": "text",
|
|
"definition": "text",
|
|
"material": "text",
|
|
"version": "text",
|
|
"setting_version": "text"
|
|
}))
|