code-to10 v7 mech merge fix: SqliteScorecardGainLedger uses cloud.db.connect instead of sqlite3.connect (arch conformance layer rule), no semantics changed
(cherry picked from commit bde36a84880574c2297aaee9ed08312cd0e2c0fc)
This commit is contained in:
1 parent
83485b9316
commit
a4c92d888c
1 file changed
+5
-2
@@ -90,6 +90,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
|
from cloud.db import connect as _db_connect
|
||||||
|
|
||||||
TABLES = ("code", "production", "product")
|
TABLES = ("code", "production", "product")
|
||||||
|
|
||||||
# 停表阈值:测试默认值、未拍板。生产阈值须用户拍板后显式传入。
|
# 停表阈值:测试默认值、未拍板。生产阈值须用户拍板后显式传入。
|
||||||
@@ -297,8 +299,9 @@ class SqliteScorecardGainLedger:
|
|||||||
self._conn = connection
|
self._conn = connection
|
||||||
self._owns_conn = False
|
self._owns_conn = False
|
||||||
else:
|
else:
|
||||||
self._conn = sqlite3.connect(str(db_path))
|
# 层规则:服务层不得直连驱动,须走 cloud.db.connect
|
||||||
self._conn.row_factory = sqlite3.Row
|
# (其 SQLite 路径已设 WAL + busy_timeout + Row)。
|
||||||
|
self._conn = _db_connect(str(db_path))
|
||||||
self._owns_conn = True
|
self._owns_conn = True
|
||||||
self._conn.execute(SQLITE_DDL)
|
self._conn.execute(SQLITE_DDL)
|
||||||
self._conn.commit()
|
self._conn.commit()
|
||||||
|
|||||||
Reference in new issue
Block a user