MCPcopy Create free account
hub / github.com/Freedium-cfd/web / connect

Method connect

database-lib/database_lib/main.py:116–129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114 self.connect()
115
116 def connect(self):
117 self.connection = sqlite3.connect(self.database, timeout=10.0)
118 self.connection.enable_load_extension(True)
119 self.connection.execute("PRAGMA foreign_keys = ON;")
120 self.connection.execute("PRAGMA journal_mode=WAL;")
121 self.connection.execute("PRAGMA auto_vacuum=full;")
122 self.cursor = self.connection.cursor()
123
124 if self.zstd_enabled:
125 if sqlite_zstd is None:
126 raise ValueError("sqlite_zstd library not found.")
127
128 sqlite_zstd.load(self.connection)
129 self.enable_zstd()
130
131 def ensure_connection(self):
132 if self.connection is None or self.cursor is None:

Callers 4

__init__Method · 0.95
ensure_connectionMethod · 0.95
maintenanceMethod · 0.45
connectMethod · 0.45

Calls 2

enable_zstdMethod · 0.95
loadMethod · 0.45

Tested by

no test coverage detected