refactor(db)!: adopt project-routed pooled databases
Reorganize WNDB by responsibility and remove legacy scheme endpoints.\n\nRoute analysis and time-series access through project pools, preserve transactional realtime replacement, and refresh GIS materialized views after writes.\n\nAdd database architecture documentation, live pooling coverage, API contract updates, and executable container verification.\n\nBREAKING CHANGE: legacy scheme APIs and flat app.native.wndb module imports are removed.
This commit is contained in:
@@ -11,8 +11,8 @@ from typing import Any
|
||||
import uuid
|
||||
|
||||
sys.path.append("..")
|
||||
from app.native.wndb import project
|
||||
from app.native.wndb import inp_out
|
||||
from app.native.wndb.core import projects
|
||||
from app.native.wndb.inp import exporter
|
||||
|
||||
|
||||
def _verify_platform():
|
||||
@@ -326,13 +326,13 @@ def _make_isolated_run_paths(base_name: str, cwd: str) -> tuple[str, str, str]:
|
||||
|
||||
# DingZQ, 2025-02-04, 返回dict[str, Any]
|
||||
def run_project_return_dict(name: str, readable_output: bool = True) -> dict[str, Any]:
|
||||
if not project.have_project(name):
|
||||
if not projects.have_project(name):
|
||||
raise Exception(f"Not found project [{name}]")
|
||||
|
||||
cwd = os.path.abspath(os.getcwd())
|
||||
|
||||
inp, rpt, opt = _make_isolated_run_paths(name, cwd)
|
||||
inp_out.dump_inp(name, inp, "2")
|
||||
exporter.dump_inp(name, inp, "2")
|
||||
|
||||
if platform.system() == "Windows":
|
||||
exe = os.path.join(os.path.dirname(__file__), "windows", "runepanet.exe")
|
||||
@@ -389,13 +389,13 @@ def run_project_return_dict(name: str, readable_output: bool = True) -> dict[str
|
||||
|
||||
# original code
|
||||
def run_project(name: str, readable_output: bool = True) -> str:
|
||||
if not project.have_project(name):
|
||||
if not projects.have_project(name):
|
||||
raise Exception(f"Not found project [{name}]")
|
||||
|
||||
cwd = os.path.abspath(os.getcwd())
|
||||
|
||||
inp, rpt, opt = _make_isolated_run_paths(name, cwd)
|
||||
inp_out.dump_inp(name, inp, "2")
|
||||
exporter.dump_inp(name, inp, "2")
|
||||
|
||||
if platform.system() == "Windows":
|
||||
exe = os.path.join(os.path.dirname(__file__), "windows", "runepanet.exe")
|
||||
|
||||
Reference in New Issue
Block a user