[Cl-perec-devel] Lots of questions :-)

Levente Mészáros levente.meszaros at gmail.com
Thu Sep 17 08:54:23 UTC 2009


> 1. I have a N-M relationship between Users and Groups.  For this, perec
>   creates an intermediate table, which is great because I don't have to
>   do it myself :-) but not so great because I don't know how I can
>   control it.
>
>   When I do (push new-group (grups-of user)) perec deletes all groups
>   of that user from the intermediate table, then re-inserts them, which
>   makes sense because one can change the whole set of groups at once,
>   but in the particular case of adding a new group seems overkill.  I
>   was wondering if there is a way to add a single instance.
insert-item should work, see the test called
test/persistence/association/m-n/collection/1

> 2. Whenever I access an associated object (or a set, such as (groups-of
>   user)) a SELECT is run.  I was wondering if there is a way to have
>   "cached" slots (in RAM, that is), at least within a transaction.
it's not yet cached automagically due to the API of inserts and
removals should also be updated
but you can always put things into the cache and live with them
we are even doing this for a tree of instances, select them with one
select and build the tree in the cache
so that other functions can use the slot accessors without doing an SQL SELECT

there is underlying-slot-value and underlying-slot-value-using-class
to change a cached value
see slot-value.lisp

> 3. Is there a way to create INDEX-es on fields other than those created
>   by defassociation or :unique slots?
:index #t
slot option should work

levy

-- 
There's no perfectoin




More information about the cl-perec-devel mailing list