Skip to content

Commit b7d3cd5

Browse files
committed
fix: minor fixes
1 parent 41f3eb8 commit b7d3cd5

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/postgres
1+
DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres

crates/pg_query_ext/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ pub fn parse(sql: &str) -> Result<NodeEnum> {
2626
.nodes()
2727
.iter()
2828
.find(|n| n.1 == 1)
29-
.unwrap()
30-
.0
31-
.to_enum()
32-
})
29+
.map(|n| n.0.to_enum())
30+
.ok_or_else(|| Error::Parse("Unable to find root node".to_string()))
31+
})?
3332
}

crates/pg_workspace_new/src/workspace/server/pg_query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl PgQueryStore {
4141

4242
pub fn modify_statement(&self, change: &ModifiedStatement) {
4343
self.remove_statement(&change.old_stmt);
44-
self.add_statement(&change.new_stmt, &change.change_text);
44+
self.add_statement(&change.new_stmt, &change.new_stmt_text);
4545
}
4646

4747
pub fn get_diagnostics(&self, stmt: &Statement) -> Vec<pg_diagnostics::serde::Diagnostic> {

0 commit comments

Comments
 (0)