From 4c87381d24cf2f3140fdef717c287a95ec60d450 Mon Sep 17 00:00:00 2001 From: Lucas Meier Date: Wed, 24 Jul 2024 19:15:13 -0700 Subject: [PATCH] Correctly handle the multi statement sql file --- crates/bin/pindexer/src/dex/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bin/pindexer/src/dex/mod.rs b/crates/bin/pindexer/src/dex/mod.rs index 1d1910c78a..18884bbc96 100644 --- a/crates/bin/pindexer/src/dex/mod.rs +++ b/crates/bin/pindexer/src/dex/mod.rs @@ -207,9 +207,9 @@ impl AppView for Component { dbtx: &mut PgTransaction, _app_state: &serde_json::Value, ) -> anyhow::Result<()> { - sqlx::query(include_str!("dex.sql")) - .execute(dbtx.as_mut()) - .await?; + for statement in include_str!("dex.sql").split(";") { + sqlx::query(statement).execute(dbtx.as_mut()).await?; + } Ok(()) }