[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Result sets - what's the "Lua way"
- From: Petite Abeille <petite.abeille@...>
- Date: Thu, 5 May 2011 19:04:48 +0200
On May 4, 2011, at 6:39 PM, Henderson, Michael D wrote:
> I'm writing a SQL interface for Oracle and have a question on representing the result sets.
Someone else pointed it out already, but perhaps it's worthwhile repeating:
Both support Oracle to various degree.
If you write your own Oracle interface, one would hope that you will provide a LuaSQL compatible API as a courtesy :)
As far as result set goes, here is the API I personally find convenient :
local aDB = DB( 'sqlite3://localhost/test.db' )
for aContact in aDB( 'select * from contact' ) do
print( aContact.name, aContact.email )
FWIW, bellow is a more fullfledge example, with associated DML: