mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
fix(scripts): pipe SQL via stdin for neon-64gb psql
Avoid shell-escaping issues by using podman exec -i and passing SQL via stdin instead of command line interpolation.
This commit is contained in:
parent
aefd06dc84
commit
772a2acc4d
1 changed files with 9 additions and 9 deletions
|
|
@ -185,7 +185,7 @@ def make_receipt_sql(rec_id: str, pkg_id: str, rec_type: str, status: str,
|
|||
f"INSERT INTO ene.receipts (id, package_id, receipt_type, status, toolchain, theorem_id) "
|
||||
f"VALUES ('{esc(rec_id)}', '{esc(pkg_id)}', '{esc(rec_type)}', "
|
||||
f"'{esc(status)}', '{esc(toolchain)}', '{esc(theorem_id)}') "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ def make_sidon_label_sql(label_id: str, set_name: str, strand_idx: int,
|
|||
return (
|
||||
f"INSERT INTO ene.sidon_labels (id, label_set_name, strand_index, label_value, sidon_slack) "
|
||||
f"VALUES ('{esc(label_id)}', '{esc(set_name)}', {strand_idx}, {label_val}, {slack}) "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ def make_braid_strand_sql(strand_id: str, snapshot_id: str, strand_idx: int,
|
|||
return (
|
||||
f"INSERT INTO ene.braid_strands (id, snapshot_id, strand_index, phase_x, phase_y) "
|
||||
f"VALUES ('{esc(strand_id)}', '{esc(snapshot_id)}', {strand_idx}, {phase_x}, {phase_y}) "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ def make_eigensolid_sql(eig_id: str, pkg_id: str, receipt_id: str,
|
|||
f"(id, package_id, receipt_id, step_count, convergence_metric, entropy, is_stable) "
|
||||
f"VALUES ('{esc(eig_id)}', '{esc(pkg_id)}', '{esc(receipt_id)}', "
|
||||
f"{step_count}, {convergence}, {entropy}, {str(is_stable).lower()}) "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ def make_gossip_node_sql(node_id: str, pkg_id: str, fold_coord: dict,
|
|||
f"VALUES ('{esc(node_id)}', '{esc(pkg_id)}', {jsonb(fold_coord)}, "
|
||||
f"'{esc(neighborhood_hash)}', '{esc(local_summary[:500])}', "
|
||||
f"{witness_mass}, {gossip_round}) "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ def make_gossip_edge_sql(edge_id: str, src_id: str, tgt_id: str,
|
|||
f"(id, source_node_id, target_node_id, edge_type, weight) "
|
||||
f"VALUES ('{esc(edge_id)}', '{esc(src_id)}', '{esc(tgt_id)}', "
|
||||
f"'{esc(edge_type)}', {weight}) "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ def make_relation_sql(rel_id: str, src_id: str, tgt_id: str,
|
|||
f"INSERT INTO ene.relations (id, source_id, target_id, relation_type, weight, provenance) "
|
||||
f"VALUES ('{esc(rel_id)}', '{esc(src_id)}', '{esc(tgt_id)}', "
|
||||
f"'{esc(rel_type)}', {weight}, {prov}) "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ def make_session_sql(session_id: str, title: str, actor: str,
|
|||
f"INSERT INTO ene.sessions (id, title, actor, toolchain, summary) "
|
||||
f"VALUES ('{esc(session_id)}', '{esc(title[:200])}', '{esc(actor)}', "
|
||||
f"'{esc(toolchain)}', '{esc(summary[:1000])}') "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ def make_ingest_event_sql(event_id: str, pkg_id: str, source_uri: str,
|
|||
f"VALUES ('{esc(event_id)}', '{esc(pkg_id)}', '{esc(source_uri)}', "
|
||||
f"'{esc(source_type)}', '{esc(source_hash)}', "
|
||||
f"'{esc(ingest_profile)}', '{esc(parser_version)}') "
|
||||
f"ON CONFLICT (id) DO NOTHING;"
|
||||
f"ON CONFLICT DO NOTHING;"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue