[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua and databases
- From: Bennett Todd <bet@...>
- Date: Tue, 15 Dec 1998 09:30:53 -0500
1998-12-15-06:24:41 Erik Hougaard:
> Dunno, but I'm planning to do a library for Microsoft SQL 7.0 - Their
> C-Library is quite simple to work with. This is my plan:
>
> (0) Connect to server
> 1. You build a SQL statement in a string
> 2. You submit the statement
> 3. You retreive rows and columns from the result
> (4) Disconnect from server
>
> Take a look at the C-Library for SQL7 and you will be surprised how
> simple it is, considering that it is a Microsoft API !
Some additions that might be useful, if they aren't already there:
(1) Allow multiple iterations of steps 1-3 on a single open connection.
(2) Use a "connection handle" of some sort, allowing multiple simultaneous
connections to the same DB.
(3) Provide a thin ``database-independant'' shim layer on top, that talks to
database-specific layers below.
That third point, the idea behind Perl's DBI/DBD system, makes it much easier
to write code against one database management system, then port it to another;
it should also support running database queries against multiple database
systems simultaneously. It'd be good to look over the docs to perl's DBI, as
that went through some years of evolution to reach its current state.
-Bennett