2021.11 #50
@ -6,7 +6,7 @@ from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
|||||||
from cpl_core.database.connection.database_connection_abc import \
|
from cpl_core.database.connection.database_connection_abc import \
|
||||||
DatabaseConnectionABC
|
DatabaseConnectionABC
|
||||||
from cpl_core.database.database_settings import DatabaseSettings
|
from cpl_core.database.database_settings import DatabaseSettings
|
||||||
from cpl_core.utils import CredentialManager
|
from cpl_core.utils.credential_manager import CredentialManager
|
||||||
from mysql.connector.abstracts import MySQLConnectionAbstract
|
from mysql.connector.abstracts import MySQLConnectionAbstract
|
||||||
from mysql.connector.cursor import MySQLCursorBuffered
|
from mysql.connector.cursor import MySQLCursorBuffered
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from cpl_core.console.console import Console
|
|
||||||
from cpl_core.database.connection.database_connection import DatabaseConnection
|
from cpl_core.database.connection.database_connection import DatabaseConnection
|
||||||
from cpl_core.database.connection.database_connection_abc import \
|
from cpl_core.database.connection.database_connection_abc import \
|
||||||
DatabaseConnectionABC
|
DatabaseConnectionABC
|
||||||
@ -31,9 +30,7 @@ class DatabaseContext(DatabaseContextABC):
|
|||||||
|
|
||||||
def connect(self, database_settings: DatabaseSettings):
|
def connect(self, database_settings: DatabaseSettings):
|
||||||
self._db.connect(database_settings)
|
self._db.connect(database_settings)
|
||||||
Console.write_line(f"Ts: {self._tables}")
|
|
||||||
for table in self._tables:
|
for table in self._tables:
|
||||||
Console.write_line(f"{table}, {table.get_create_string()}")
|
|
||||||
self._db.cursor.execute(table.get_create_string())
|
self._db.cursor.execute(table.get_create_string())
|
||||||
|
|
||||||
def save_changes(self):
|
def save_changes(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user