From cfdfe0eb50034d54a08c8449e8a62a5b8854e259 Mon Sep 17 00:00:00 2001 From: Interitio Date: Thu, 31 Jul 2025 08:21:55 +1000 Subject: [PATCH] Remove version method. --- database.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/database.py b/database.py index 255e412..915a459 100644 --- a/database.py +++ b/database.py @@ -2,15 +2,12 @@ from typing import TypeVar import logging from collections import namedtuple -# from .cursor import AsyncLoggingCursor from .registry import Registry from .connector import Connector logger = logging.getLogger(__name__) -Version = namedtuple('Version', ('version', 'time', 'author')) - T = TypeVar('T', bound=Registry) @@ -30,18 +27,3 @@ class Database(Connector): registry.bind(self) self.registries[registry.name] = registry return registry - - async def version(self) -> Version: - """ - Return the current schema version as a Version namedtuple. - """ - async with self.connection() as conn: - async with conn.cursor() as cursor: - # Get last entry in version table, compare against desired version - await cursor.execute("SELECT * FROM VersionHistory ORDER BY time DESC LIMIT 1") - row = await cursor.fetchone() - if row: - return Version(row['version'], row['time'], row['author']) - else: - # No versions in the database - return Version(-1, None, None)