Version 0 of ORM

Updated 2010-05-15 17:12:44 by dkf

ORM is an Object–Relational database Mapper, being worked on by DKF.

Currently, it's available in the half-bakery only. It lacks a number of key features, such as the ability to tell if the database has been changed under its feet, the ability to write changes back to the database, and the ability to clean up.

Documentation

[You've got to be joking?!]

Example

package require tdbc::sqlite3
package require ORM

ORM::MappedDatabase create db [tdbc::sqlite3::connection new "/path/to/mydatabase.sqlite3"] {
    order:customer  customers:id
    order:dispatch  dispatch:id
}

foreach o [[MyDatabase classForTable order] findAll] {
    puts "Order: [$o id]"
    puts "Customer: [[$o customer] firstname] [[$o customer] surname]"
    puts "Address: [[$o dispatch] house] [[$o dispatch] street]"
    puts "Address: [[$o dispatch] city], [[$o dispatch] state]"
    puts "Description:\n\t[$o description]"
}