Update public source
This commit is contained in:
@@ -41,6 +41,27 @@ class MethodsRepository:
|
||||
),
|
||||
)
|
||||
|
||||
def update_method(
|
||||
self,
|
||||
method_id: str,
|
||||
name: str,
|
||||
description: str | None = None,
|
||||
) -> None:
|
||||
self._conn.execute(
|
||||
"""
|
||||
UPDATE crack_methods
|
||||
SET
|
||||
name = ?,
|
||||
description = ?
|
||||
WHERE id = ?
|
||||
""",
|
||||
(
|
||||
name,
|
||||
description,
|
||||
method_id,
|
||||
),
|
||||
)
|
||||
|
||||
def get_method(self, method_id: str) -> sqlite3.Row | None:
|
||||
row = self._conn.execute(
|
||||
"""
|
||||
@@ -99,6 +120,32 @@ class MethodsRepository:
|
||||
),
|
||||
)
|
||||
|
||||
def update_method_version(
|
||||
self,
|
||||
method_id: str,
|
||||
version: int,
|
||||
definition: dict[str, Any],
|
||||
) -> None:
|
||||
self._conn.execute(
|
||||
"""
|
||||
UPDATE crack_method_versions
|
||||
SET
|
||||
definition_json = ?
|
||||
WHERE method_id = ?
|
||||
AND version = ?
|
||||
""",
|
||||
(
|
||||
json.dumps(
|
||||
definition,
|
||||
ensure_ascii=False,
|
||||
separators=(",", ":"),
|
||||
sort_keys=True,
|
||||
),
|
||||
method_id,
|
||||
version,
|
||||
),
|
||||
)
|
||||
|
||||
def get_method_version(
|
||||
self,
|
||||
method_id: str,
|
||||
|
||||
Reference in New Issue
Block a user