2025-03-23 21:21:05 +00:00
|
|
|
# vim: set et sta sw=4 ts=4 :
|
|
|
|
|
|
|
|
|
|
import
|
|
|
|
|
std/re
|
2025-11-04 09:06:11 -08:00
|
|
|
import ladybug
|
2025-03-23 21:21:05 +00:00
|
|
|
|
2025-11-04 09:06:11 -08:00
|
|
|
let db = newLbugDatabase()
|
2025-03-23 21:21:05 +00:00
|
|
|
let conn = db.connect
|
|
|
|
|
|
|
|
|
|
var q = conn.query( "CREATE NODE TABLE Doop ( id SERIAL, thing STRING, PRIMARY KEY(id) )" )
|
|
|
|
|
|
|
|
|
|
var p = conn.prepare( "CREATE (d:Doop {thing: $thing})" )
|
2025-11-04 09:06:11 -08:00
|
|
|
assert typeOf( p ) is LbugPreparedStatement
|
2025-03-23 21:21:05 +00:00
|
|
|
|
|
|
|
|
try:
|
2025-11-04 09:06:11 -08:00
|
|
|
discard p.execute( (nope: "undefined var in statement!", thing: "yep") )
|
|
|
|
|
except LbugQueryError as err:
|
2025-03-23 21:21:05 +00:00
|
|
|
assert err.msg.contains( re"""Parameter nope not found.""" )
|
|
|
|
|
|
|
|
|
|
|