squeak to meet databases

Yanni Chiu yanni at rogers.com
Sun Aug 8 04:41:01 UTC 2004


Kamil Kukura wrote:
> [...]
> I use it and it's quote cool. I like it as a proof that native RDB
> drivers can be written in Squeak. I think almost all RDBs can be
> contacted from sockets and I don't see need to go other way.

So to summarize, you'd like to see native Squeak connections to
more RDB's, and all connections should have a common interface.

I certainly agree that more native drivers is desirable,
but the constraint is that the format and meaning of the
messages which flow over the socket must be available.
I'm not sure whether Oracle, DB2 (UDB?), SQL Server make
this information available.

However, a common DB interface may be problematic. It would
force inefficiencies based on a perceived advantage of portability
across databases. The inefficiencies would be unnecessary format
conversions and lost optimization opportunities. I say "perceived"
portability because in practice, the SQL is not portable, or some
unique database feature is being used. So you pay a price for
portability that isn't real.

Aside. Here's a potential optimization opportunity, which would
be lost under a common interface. The row of the result set of
the PostgreSQL client has a #rawData method, which returns whatever
the backend sent. Since the backend returns numbers as ASCII strings,
you can completely avoid two conversions if the raw value is piped
straight to the display.
 
> Right now version 2 seems OK. For another version I vote for cursor
> support in resultsets. I'm not sure if PostgreSQL does have support for
> uni- or bi- directional cursors.

Cursors was the reason I looked a version 3, but then I realized
that "CURSOR" support is done in the SQL, so was already supported
in version 2. The other reason to want v3 was to avoid reading
a huge result set, which might consume too much memory. But the "LIMIT"
keyword may give a good enough solution.

What you're describing as cursor support in resultsets, I think
is refering to the new v3 protocol changes which pulls the result
rows from the server a few at a time (instead of one big chunk).

--yanni



More information about the Squeak-dev mailing list