babashka / pod-babashka-go-sqlite3

A babashka pod for interacting with sqlite3.
BSD 3-Clause "New" or "Revised" License
35 stars 4 forks source link

The pod gets stuck when execute! is called with a string #8

Closed miikka closed 2 years ago

miikka commented 2 years ago

I've played around a bit with this pod and I mistakenly called execute! with a string instead of a vector a couple of times.

(ns foo
  (:require [babashka.pods :as pods]))

(pods/load-pod 'org.babashka/go-sqlite3 "0.0.1")
(require '[pod.babashka.go-sqlite3 :as sqlite])

(sqlite/execute! "temp.db" "create table if not exists foo(my_text TEXT)")

What happens is that you get the following error message and babashka (v 0.7.4) never exits:

% bb foo.clj 
panic: interface conversion: interface {} is string, not []interface {}

goroutine 1 [running]:
main.parseQuery(0xc00001e050, 0x45, 0x0, 0x42e92c0, 0xc000010048, 0x42e92c0, 0xc000010048, 0xc00012df50, 0x4108a05, 0x436dca0, ...)
    /Users/distiller/project/main.go:102 +0x286
main.processMessage(0xc00006c180)
    /Users/distiller/project/main.go:150 +0x151
main.main()
    /Users/distiller/project/main.go:205 +0x39

A bit more descriptive error message and not getting stuck would be handy.

lispyclouds commented 2 years ago

Closed via #10

borkdude commented 2 years ago

Released as 0.1.0.