Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions hivemind_sqlite_database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@

from hivemind_plugin_manager.database import Client, AbstractDB

from dataclasses import dataclass


@dataclass
class SQLiteDB(AbstractDB):
"""Database implementation using SQLite."""
name: str = "clients"
subfolder: str = "hivemind-core"

def __init__(self, name="clients", subfolder="hivemind-core"):
def __post_init__(self):
"""
Initialize the SQLiteDB connection.
"""
db_path = os.path.join(xdg_data_home(), subfolder, name + ".db")
db_path = os.path.join(xdg_data_home(), self.subfolder, self.name + ".db")
LOG.debug(f"sqlite database path: {db_path}")
os.makedirs(os.path.dirname(db_path), exist_ok=True)

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hivemind-plugin-manager>=0.1.0,<1.0.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def required(requirements_file):
url='https://github.com/JarbasHiveMind/hivemind-sqlite-database',
license='Apache-2.0',
author='jarbasAi',
# install_requires=required("requirements.txt"),
install_requires=required("requirements.txt"),
entry_points={'hivemind.database': PLUGIN_ENTRY_POINT},
author_email='[email protected]',
description='sqlite database plugin for hivemind-core'
Expand Down
Loading