chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] DBI


From: Alex Shinn
Subject: Re: [Chicken-users] DBI
Date: Sat, 01 Mar 2008 19:47:23 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin)

>>>>> "Tobia" == Tobia Conforto <address@hidden> writes:

    Tobia> Alex Shinn wrote:
    >> The biggest issue I see with the sql egg right now is
    >> it currently hard-codes all values, generating a new
    >> SQL expression every time.  You want it to be able to
    >> represent placeholder values (named or just with a ?)
    >> ...  It makes more sense to integrate the SQL
    >> generation with the backends from the start.

    Tobia> What you propose might get really complex.

    [...]

    Tobia> The DBI should just provide a standard way to
    Tobia> compile prepared statements, so that an improved
    Tobia> sql egg could use prepared statements across all
    Tobia> DBs that support it.  IMHO the key is lessening
    Tobia> the burden on the backend writer, while providing
    Tobia> most features of modern DBs in a consistent
    Tobia> interface.

I'd have to disagree, and say that the key, as with any
programming library, is lessening the burden on the user.
Do the hard work once so it doesn't have to be duplicated.

Every other DBI library for every language I've ever seen
allows prepared statements.

    >> The issue isn't just with the actual query string
    >> generated either.  We may want the high-level
    >> interface to always allow the LIMIT and OFFSET
    >> keywords to page results, even if the backend doesn't
    >> support it, by emulating it on the client side.

    Tobia> Uhh, still more burden on the backend writer?  I
    Tobia> don't like the sound of it.  Besides, if you need
    Tobia> limit and offset, you might as well upgrade to
    Tobia> another RDBMS.

ROFL!  Tell Oracle users to "upgrade" to another RDBMS :)

Oracle has no LIMIT or OFFSET - there's a trick you can use
to make a nested SELECT and filter by row-number, but
usually it's recommended to just return a cursor and let the
client read and discard the initial unneeded rows then only
read the remaining LIMIT rows.

-- 
Alex




reply via email to

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