From 2f18a343d8f8299ca8b970b7c1cb73cb2fda816d Mon Sep 17 00:00:00 2001 From: Peng_Lx Date: Mon, 20 Mar 2023 21:47:35 +0800 Subject: [PATCH] Create Database abstract class and make a sqlite example for it --- src/educoder/database/database.py | 3 +++ src/educoder/database/database_sqlite.py | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/educoder/database/database.py create mode 100644 src/educoder/database/database_sqlite.py diff --git a/src/educoder/database/database.py b/src/educoder/database/database.py new file mode 100644 index 0000000..3318868 --- /dev/null +++ b/src/educoder/database/database.py @@ -0,0 +1,3 @@ +class Database(object): + def connection(self): + pass diff --git a/src/educoder/database/database_sqlite.py b/src/educoder/database/database_sqlite.py new file mode 100644 index 0000000..231b093 --- /dev/null +++ b/src/educoder/database/database_sqlite.py @@ -0,0 +1,10 @@ +import database +import sqlite3 + + +class DatabaseSQLite(database.Database): + conn = sqlite3.connect + + def connection(self): + self.conn = sqlite3.connect("../../../data/lib_manager.db") +