[Cl-perec-devel] Idea to query language
Levente Mészáros
levente.meszaros at gmail.com
Fri Dec 12 19:56:10 UTC 2008
2008/12/12 Makarov Alexey <alexeys9 at mail.ru>:
> Hello.
> I have an idea about query language.
> Often I write conditions for querying objects that contains in their slots
> (objects have the same class) one of values containing in the list, and form--
I'm not sure, but is this what you really want?
PRCT> (defpclass* xxx ()
((slot :type integer-16)))
#<PERSISTENT-CLASS XXX>
PRCT> (with-transaction
(make-instance 'xxx :slot 1))
#<XXX :persistent #t 66263>
PRCT> (start-sql-recording)
; No value
PRCT> (with-transaction
(select (i)
(from (i xxx))
(where (member (slot-of i) '(1 2 3)))))
; BEGIN
; SELECT _i._oid, _i._slot FROM _xxx_ap _i WHERE ((_i._slot IN (1, 2, 3)))
; COMMIT
(#<XXX :persistent #t 66263>)
PRCT> (with-transaction
(select (i)
(from (i xxx))
(where (member (slot-of i) '(10 20 30)))))
; BEGIN
; SELECT _i._oid, _i._slot FROM _xxx_ap _i WHERE ((_i._slot IN (10, 20, 30)))
; COMMIT
NIL
levy
There's no perfectoin
More information about the cl-perec-devel
mailing list