[postmodern-devel] patch: DAO constraints

Marijn Haverbeke marijnh at gmail.com
Sat Oct 11 10:24:51 UTC 2008


Hey Maciej,

I have no time to look into this right away -- but did you see the
deftable stuff? The idea is that you combine all the stuff needed to
define a table or view in a deftable form. I intentionally didn't
include complicated functionality in the DAO syntax, since they are
just access objects, not definitions, and trying to support everything
there is an endless labour. Constraints can be added after a table has
been defined, which is how I usually do it (if I remember correctly
theres already a !foreign operator, and similar ones can be defined
for other useful constraints).

Cheers,
Marijn


2008/10/11 Maciej Pasternacki <maciej at pasternacki.net>:
> Hello,
>
> Since it's not my first patch for Postmodern, and most probably not the last
> one, I can as well subscribe to the list and send patches properly instead
> of in a private e-mail.
>
> I just made a small update to DAOs to use constraints (foreign keys, checks,
> indices) for DAO slots and classes.  Doesn't seem to break anything, and
> makes it possible (or almost possible) to drop separate .sql definition
> files and just use DAO-TABLE-DEFINITION.
>
> What's missing for me is arbitrary SQL for e.g. defining needed functions,
> enum types and so on before creating table -- but I'm not sure what approach
> should I take: move it all to DAOs (as e.g. :BEFORE-CREATE-TABLE and
> :AFTER-CREATE-TABLE class slots), or just make init function for my package,
> which would call needed queries and use DAO-TABLE-DEFINITION just to create
> the tables.  Would there be any advantage to :BEFORE-... and :AFTER-...
> slots, or is the init function the preferred way to go?
>
> Regards,
> Maciej.
>
>
> --
> -><- Maciej Pasternacki -><- http://www.pasternacki.net/ -><-
>
>
> _______________________________________________
> postmodern-devel mailing list
> postmodern-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
>
>




More information about the postmodern-devel mailing list