Hi all,

I'm fumbling through some tests trying to get an understanding of how to
insert and retrieve database objects:

t3.l:
(class +Cls +Entity)
(rel id (+Need +Key +String))
(rel val (+Need +String))
(dm T ()
   (=: id (pack (in "/dev/urandom" (rd 5))))
   (=: val *Val) )

(pool "test.db")
(setq *Val "value")

: (load "t3.l")
-> "value"
: (new! '(+Cls))
-> {2}
: (show '{2})
{2} (+Cls)
   val "value"
   id "701131216474"
-> {2}
: (collect 'id '+Cls)
-> NIL
: (obj '(+Cls))
-> NIL
: (new T '(+Cls))
-> {3}
: (show '{3})
{3} (+Cls)
   val "value"
   id "240722338378"
-> {3}
: (commit)
-> T
: (collect 'id '+Cls)
-> NIL
: (select '+Cls)
<picolisp goes into a loop>
Process picolisp killed

: (pool "test.db")
-> T
: (show '{2})
{2} (+Cls)
   val "value"
   id "701131216474"
-> {2}
: (collect '+Cls)
-> NIL
: (collect 'id '+Cls)
-> NIL
: (collect 'val '+Cls)
-> NIL
 (select '+Cls)

Process picolisp killed (kill -9, looped again)

So, my question is, how do I retrieve the objects out of the database,
short of the {N} notation?
More importantly, how do I return a collection of all of them so I can
filter them?

TIA,
Dave

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to