[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Re: [ANN] New egg: Object-relation mapper Pandora

From: Thomas Chust
Subject: Re: [Chicken-users] Re: [ANN] New egg: Object-relation mapper Pandora
Date: Fri, 21 Aug 2009 01:51:33 +0200

2009/8/20 Peter Bex <address@hidden>:
> On Thu, Aug 20, 2009 at 06:24:27PM +0200, Thomas Chust wrote:
>> * A complete usage example has been added to the documentation.
> In the example, the 'name' column in the 'Tags' table should be TEXT,
> shouldn't it?
> [...]


of course the declared type doesn't matter much when SQLite3 is used
as the backend -- but it just looks wrong ;-) I fixed the example

> [...]
> There's a problem in the 'match method with Postgres, in the presence of
> link slots.  If I tweak the example a bit to work under postgres, I get
> an error at  (pretty-print ((a-post 'in-reply-to*) 'count)) :
>  Error: (collect-results) ERROR:  subquery in FROM must have an alias
>  HINT:  For example, FROM (SELECT ...) [AS] foo.
> [...]

Oh my, why does everything have to have an explicit name in
PostgreSQL? It makes generation of statements truly awkward and has no
real benefit :-/

I fixed this by giving each of the subclauses some unique generated
name for PostgreSQL, which is not only totally useless by itself but
also renders statement caching futile :-( Well, at least it works
correctly and we can still rely on the PostgreSQL server to do some
caching of its own.

2009/8/20 Peter Bex <address@hidden>:
> On Thu, Aug 20, 2009 at 08:38:39PM +0200, Thomas Chust wrote:
>> [...]
>> I admit that this use of import libraries in unorthodox, but it should
>> not be problematic unless the names of the procedures imported ad used
>> from the database driver eggs change, in which case the Pandora
>> backends have to be adapted anyway.
> It sounds very brittle.  Perhaps Felix can enlighten us to whether it's
> a good idea to do it like this?
> [...]

I don't think this is brittle. It only makes the assumption that the
visible API of the database driver does not change between compilation
and execution time. Every program makes such an assumption of time
invariant APIs at some point -- if nowhere else, then at the kernel
userspace boundary.

And after all, the bundled import libraries should be used during
compilation of Pandora if and only if the corresponding database
driver eggs are not installed, so even if some change in the API of a
database driver makes the import libraries invalid, but requires no
changes in client code (which is unlikely), Pandora can be fixed by
simply recompiling it after installing the drivers in question.

2009/8/20 Peter Bex <address@hidden>:
> [...]
> I had another look at libpq, but now I remember why the postgresql egg
> doesn't support prepared statements: they can be entered using SQL.
> [...]

Thanks for pointing this out.


When C++ is your hammer, every problem looks like your thumb.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]