We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1038e6 commit e2c93b1Copy full SHA for e2c93b1
simple_query_builder/database.py
@@ -17,23 +17,26 @@ def __call__(cls, *args, **kwargs):
17
18
19
class DataBase(metaclass=MetaSingleton):
20
- driver = "sqlite"
21
- db_name = ":memory:"
22
- conn = None
23
- cursor = None
+ _driver = "sqlite"
+ _db_name = ":memory:"
+ _conn = None
+ _cursor = None
24
25
def connect(self, db_name: str = "", uri: bool = False):
26
if db_name:
27
- self.db_name = db_name
+ self._db_name = db_name
28
29
- if self.conn is None:
30
- if self.driver == "sqlite":
31
- self.conn = sqlite3.connect(self.db_name, uri=uri)
32
- self.cursor = self.conn.cursor()
+ if self._conn is None:
+ if self._driver == "sqlite":
+ self._conn = sqlite3.connect(self._db_name, uri=uri)
+ self._cursor = self._conn.cursor()
33
else:
34
print("Wrong DB driver. At present time it's supported 'sqlite' only")
35
36
- return self.conn
+ return self._conn
37
38
def c(self):
39
- return self.cursor
+ return self._cursor
40
+
41
+ def get_driver(self):
42
+ return self._driver
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments