Run: black and isort
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import logging
|
||||
from typing import Dict, Any
|
||||
from typing import Any, Dict
|
||||
|
||||
from .interface import DatabaseInterface
|
||||
from .sqlite_db import SQLiteDatabase
|
||||
|
||||
@@ -11,18 +12,18 @@ class DatabaseFactory:
|
||||
@staticmethod
|
||||
def create_database(db_type: str, config: Dict[str, Any]) -> DatabaseInterface:
|
||||
|
||||
if db_type.lower() == 'sqlite':
|
||||
if 'path' not in config:
|
||||
if db_type.lower() == "sqlite":
|
||||
if "path" not in config:
|
||||
raise ValueError("SQLite configuration requires 'path'")
|
||||
return SQLiteDatabase(config['path'])
|
||||
return SQLiteDatabase(config["path"])
|
||||
|
||||
elif db_type.lower() == 'mysql':
|
||||
elif db_type.lower() == "mysql":
|
||||
# Für später: MySQL-Implementierung
|
||||
# from .mysql_db import MySQLDatabase
|
||||
# return MySQLDatabase(config)
|
||||
raise NotImplementedError("MySQL support not yet implemented")
|
||||
|
||||
elif db_type.lower() == 'postgresql':
|
||||
elif db_type.lower() == "postgresql":
|
||||
# Für später: PostgreSQL-Implementierung
|
||||
# from .postgresql_db import PostgreSQLDatabase
|
||||
# return PostgreSQLDatabase(config)
|
||||
|
||||
Reference in New Issue
Block a user