4 Commits

Author SHA1 Message Date
Gitea CI
1776d17c52 Bump version: 0.1.1 → 0.1.2 2025-06-03 18:32:53 +00:00
afec45a002 Merge pull request 'Feature: add delete function to delete entries in the database' (#5) from dev into main
Reviewed-on: #5
2025-06-03 19:30:08 +01:00
4e0a19c973 update workflow 2025-06-03 20:28:33 +02:00
9269736f23 add delete function 2025-06-03 20:25:51 +02:00
3 changed files with 18 additions and 2 deletions

View File

@@ -21,10 +21,15 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master
with:
fetch-depth: 0
fetch-tags: true
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install
with:
python-version-file: "pyproject.toml"
- name: Set Git identity
run: |
git config user.name "Gitea CI"

View File

@@ -1,6 +1,6 @@
[project]
name = "komcache"
version = "0.1.1"
version = "0.1.2"
description = "Add your description here"
readme = "README.md"
authors = [
@@ -21,7 +21,7 @@ build-backend = "hatchling.build"
komconfig = { workspace = true }
[tool.bumpversion]
current_version = "0.1.1"
current_version = "0.1.2"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"

View File

@@ -123,6 +123,17 @@ class KomCache:
log.error(f"Error updating data: {e}")
return False
def delete(self, query: str, args: dict[str, Any]) -> bool:
try:
session = self.Session()
session.execute(text(query), args)
session.commit()
session.close()
return True
except SQLAlchemyError as e:
log.error(f"Error deleting data: {e}")
return False
def get_last_update_date(self, series_name: str) -> str:
try:
session = self.Session()