Add basic tuple and value fetching from queries.

Add safeties for =destroy hooks.

FossilOrigin-Name: 2fae5297a0d0598cc3580777688b4f4307de008d4f379d2fb224c8a74cb9b708
This commit is contained in:
mahlon 2025-03-22 22:28:22 +00:00
parent 1ed442a68a
commit 7850a79372
14 changed files with 237 additions and 17 deletions

View file

@ -0,0 +1,19 @@
# vim: set et sta sw=4 ts=4 :
discard """
output: "Camel\nLampshade\nDelicious Cake\n"
"""
import kuzu
let db = newKuzuDatabase()
let conn = db.connect
var q = conn.query( "CREATE NODE TABLE Doop ( id SERIAL, thing STRING, PRIMARY KEY(id) )" )
for thing in @[ "Camel", "Lampshade", "Delicious Cake" ]:
q = conn.query( "CREATE (d:Doop {thing: '" & thing & "'})" )
for tpl in conn.query( "MATCH (d:Doop) RETURN d.thing" ):
echo $tpl