lua-users home
lua-l archive

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



On Aug 14, 2005, at 15:06, Klaus Ripke wrote:

What would such a tool do, mapping which object system?

Forget 'objects'. Think plain Lua tables then.

Isn't most of the OR/M work about type mapping,

No. They are mostly about relationships mapping and object graphs.

which is mostly a non-issue with Lua?

Types? From Lua's point of view, they are not that interesting indeed as they are mostly reduced to string vs number.

Or would you want to set up set methods derived
from constraints found in the DB?

Yes.

Or have Lua errors trigger DB rollbacks?

Hmmm...?!?

Or have "finally" commit?

Autocommit?

Use yet more new syntax for transactions?

Hopefully not.

Don't grasp how this would apply to Lua!?
Could you describe a real problem which could have a mucher
nicer solution using some O/RM?

Automatic relationship resolution perhaps?

Say you have two (SQL) tables: Movie and Studio. With a one-to-one relationship from 'Movie' to 'Studio' and a reverse one-to-many relationship between Studio and Movie. After fetching, you could now query your (Lua) table like such:

local aStudio = aMovie.studio
local someMovies = aStudio.movies

Furthermore, you could say:

aMovie.studio = anotherStudio

And have the library transparently handle the resulting updates/deletes, etc...

Wouldn't we need a "full fledge" object system first?

Forget the "object system". Lua has none. Lets stay focus on the T/RM mapping for a second :)

Could you give hints what could be improved in plain lua-style
use of LuaSQL?

Mostly automatic relationships resolution, manipulation and related nastiness like row uniquing, faulting and such:

http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/ Articles/cdFaultUniquing.html

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/