first commit
Build and deploy / build-and-push (push) Successful in 17s
Build and deploy / deploy (push) Successful in 10s

This commit is contained in:
william
2026-08-21 16:23:49 +02:00
committed by william
commit 3f4ebc4527
248 changed files with 10180 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import db
from .ensure_flow_schema import ensure_flow_schema
from .constants import FLOW_NODE_FIELDS
def add_flow_node(slug, screen_id, node_type, x=40, y=40, **fields):
ensure_flow_schema(slug)
cols = ["screen_id", "node_type", "x", "y"]
vals = [screen_id, node_type, x, y]
for k, v in fields.items():
if k in FLOW_NODE_FIELDS and v not in (None, ""):
cols.append(k)
vals.append(v)
placeholders = ", ".join("?" for _ in cols)
conn = db.connect(slug)
conn.execute(f"INSERT INTO _flow_nodes ({', '.join(cols)}) VALUES ({placeholders})", vals)
node_id = conn.execute("SELECT last_insert_rowid() AS id").fetchone()["id"]
conn.commit()
conn.close()
return node_id