Skip to content

Commit

Permalink
fix: allow queries to end in a ; followed by whitespace
Browse files Browse the repository at this point in the history
For compatibility with xtsql in the quickstart

Fixes #24
  • Loading branch information
Akeboshiwind committed Apr 10, 2024
1 parent f56d7f1 commit ed37f4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/xt_fiddle/run.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
(str))
:xtql (str "[" txs "]")))

(defn remove-last-semicolon [s]
(str/replace s #";\s*$" ""))

(defn encode-query [query type]
(case type
:sql (pr-str query)
:sql (-> query remove-last-semicolon pr-str)
:xtql query))

(rf/reg-event-fx ::run
Expand Down

0 comments on commit ed37f4f

Please sign in to comment.