Picon

Installing CL-Perec

Dear all,

I am very eager to try cl-perec, which looks great.

However, I stumbled on a lot of difficulties trying to install it with
cl-build and a recent version of sbcl.

First, it seems that it conflict with the package lock on
Alexandria.0.dev, where ensure-list is already defined.

Then, I can't find a way to have the package metacopy-with-contextl to
be available.

What is the recommended way to install cl-perec?

Thank you very much for your help.

Best regards,

Nicolas.

Tomas Hlavaty | 17 Mar 13:10
Picon
Favicon

oracle port

Hi Tomi,

I am starting to work on porting hu.dwim.rdbms to oracle (and
hu.dwim.perec later) and I would like to ask what state was the oracle
backend last time it was maintained?  What version of oracle database
did you use?

Thank you,

Tomas

Tomas Hlavaty | 9 Mar 12:09
Picon
Favicon

QA

Hi all,

I would like to ask what is your policy regarding quality of the live
repository?  There are quite a few tests failing there so I wonder what
is the difference between live and head and also how do I know that the
code is stable enough for merging it into my own repository for further
work?

Thank you,

Tomas

Tomas Hlavaty | 29 Jan 16:52
Picon
Favicon

Re: allegro port

Hi Levy,

> I think this happens in slot-value.lisp at:

thanks a lot!

> This is a protection against a mismatch in the instance/slot pair.
> This would be desirable for standard slots too, but we can get rid of
> that, because I don't think we loose that much.

I see. I don't know how important this debugging check is.  It could
stay there on sbcl using sb-pcl::%class as before but then it'd be a bit
messy.  Another solution could be creating new portable class for
non-persistent slots, something like transient-slot-definition and
holding the %%class value there although that might be overkill.

> If we support this only for persistent classes, then it might be a
> good idea to follow the naming convention there instead of the generic
> slot-definition-* for standard slots.

I guess you mean calling it persistent-slot-definition-class?

Regards,

Tomas

Tomas Hlavaty | 21 Jan 16:10
Picon
Favicon

allegro port

Hi all,

thank you for cl-perec/hu.dwim.perec.  I am porting it to allegro and I
would like to ask whether you would be interested in portability
patches?  For start, I published my darcs repositories at:

   http://www.knowledgetools.de/tmp/temporaer/tomas/hu.dwim.walker/
   http://www.knowledgetools.de/tmp/temporaer/tomas/hu.dwim.serializer/

Any feedback is welcome.

Thank you,

Tomas

Leonid Novikov | 1 Dec 15:11
Picon

mapping for set

I worked with hu.dwim.perec (live repo from 04.11.2009) and collided
with the following behavior:

HOME> (defpclass* test1 () ((c1 :type string)))
#<PERSISTENT-CLASS TEST1>
HOME> (hu.dwim.perec::mapping-of (nth 4 (class-slots (find-class 'test1))))
#<HU.DWIM.PEREC::MAPPING {10872E01}>
HOME> (defpclass* test2 () ((c2 :type (set test1))))
#<PERSISTENT-CLASS TEST2>
HOME> (hu.dwim.perec::mapping-of (nth 4 (class-slots (find-class 'test2))))
NIL

This is correct?

Mihai Bazon | 16 Oct 15:50

How to select individual fields?

Hi,

I'm trying to write a query that selects only a few fields.

Example that works:

  (select ((create-time-of o))
    (from (o db-template)))

  ; SELECT _o._create_time FROM _db_template_ap _o

Adding one more field though results in a SELECT that covers all
fields:

  (select ((create-time-of o) (modify-time-of o))
    (from (o db-template)))

  ; SELECT _o._oid, _o._edition, _o._create_time, _o._modify_time,
  _o._name, _o._body_type, _o._edited_body, _o._processed_body,
  _o._parent_oid FROM _db_template_ap _o

Is there any way to fetch more than one field, but not all, in a single
query?

Thanks,
-Mihai
Valeriy Fedotov | 12 Oct 23:38
Picon

Bug with accessors to boolean field.

Hello.

I think I have found a bug in cl-perec. The following lines in REPL
reproduce it. (My lisp is SBCL 1.0.29, cl-perec and all required
libraries are installed via clbuild.)

(asdf:oos 'asdf:load-op :cl-perec)

(in-package :cl-perec)

;; Then I connect to database, Postgresql in my case.

(defpclass* example ()
       ((f1 :type string)
	(f2 :type boolean)))

(with-transaction
       (make-instance 'example :f1 "123" :f2 t))

(with-transaction
       (let ((e (select-instance (e example))))
	 (f1-of e)))
;; Works fine and returns "123"

(with-transaction
       (let ((e (select-instance (e example))))
	 (f2-of e)))
;; The function F2-OF is undefined.
;;    [Condition of type UNDEFINED-FUNCTION]

(Continue reading)

Mihai Bazon | 9 Oct 15:00

Optimization question

Hi folks,

Here are two variants, I'd say equivalent, to select some objects:

   (select-instances (o) (where (typep o 'db-group)))

   (defvar tmp 'db-user)
   (select-instances (o) (where (typep o tmp)))

Both work the same, but the first one is better because it results in a
single select that fetches the data as well.  Here's what I see using
start-sql-recording:

1st version:

; SELECT _o._oid, _o._edition, _o._name, _o._description FROM _db_group_ap _o

2nd version:

; SELECT _o._oid FROM _db_group_ai _o
; $1 = 69012 as BIGINT
; SELECT _edition, _name, _description FROM _db_group_dd WHERE (_oid = $1::BIGINT)
; $1 = 134548 as BIGINT
; SELECT _edition, _name, _description FROM _db_group_dd WHERE (_oid = $1::BIGINT)
; $1 = 200084 as BIGINT
; SELECT _edition, _name, _description FROM _db_group_dd WHERE (_oid = $1::BIGINT)

I presume there's some compile-time magic that happens in case 1 and not
in case 2.  I can't hard-code the type so I'd like to use the second
variant, but is it possible to optimize it so that it results in a
(Continue reading)

Mihai Bazon | 3 Oct 11:23

undefined variable: PERSISTENT-OBJECT

Hi,

Using the following code to select a few instances:

(with-transaction
  (select-instances (o)
    (where (member (oid-of o) list-of-oids))))

If I specify a type, i.e. (select-instances (o base-type)) then it
works (even if the selected instances are of mixed types derived from
base-type), but without it I get this warning:

; caught WARNING:
;   This variable is undefined:
;     PERSISTENT-OBJECT

Probably a bug in perec?

Cheers,
-Mihai
Mihai Bazon | 20 Sep 11:47

Re: JSON serialization

(resending to the list as well)

Maciej Katafiasz <mathrick <at> gmail.com> wrote:
> On Sat, Sep 19, 2009 at 2:11 PM, Mihai Bazon <mihai <at> bazon.net> wrote:
> > (declare (ignorable (last-email-from 'mishoo)))   ;-)
> >
> > My mistake, it's doable without touching perec...  I should take more
> > MOP for breakfast before posting to the list.
> 
> Which shouldn't be taken to mean you shouldn't post your results regardless :)

Well, I thought it's a bit lengthy and maybe not interesting for the wizards
on this list and besides, I'm still not very satisfied with the outcome, but
here goes.

Metaclass
=========

I defined a metaclass that will be used for my persistent objects instead of
the default cl-perec:persistent-class.  It contains a json-props slot that
collects JSONizable properties as classes using this metaclass are defined.
It's metaclass in turn must be computed-class:computed-class, in order to be
compatible with cl-perec:persistent-class.

    (defparameter *json-serialization* 0)

    (defclass dlweb.db.metaclass (persistent-class)
      ((json-props :initform nil :type list :accessor json-props))
      (:metaclass computed-class:computed-class))

(Continue reading)


Gmane