[Seaside] Automatic Object Storage To MySQL

Blanchard, Todd tobl at amazon.com
Thu Jan 26 01:02:06 CET 2006


I would encourage you to keep the MySQL-specific stuff in its own classes that can be swapped to support additional databases. (I specifically avoid mysql in favor or Postgres for a bunch of reasons - licensing among them).

-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of William Harford
Sent: Wednesday, January 25, 2006 12:40 PM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: [Seaside] Automatic Object Storage To MySQL

I don't mean to get to far off topic but I figured some people on this mailing list might be interested.

I have written some code that allows automatic storage of Objects to a MySQL database without the developer having to write any SQL or create a single table. It does this by examining the objects i-vars creating a table and saving them to a database biased on what it finds.

Only a few member types are supported (hopefully more in the future)
   1. Nil
   2. String
   3. Number
   4. Boolean
   5. Date
   6. DateAndTime
   7. Float
   8. Array (Dictionary)
   9. List (OrderedCollection)
   10. Class (My not apply to languages other than Smalltalk)
   11. Children of IOSPersistence

Objects can not change type. So member var foo can not contain a String one minute and a Number the next. But it can contain any child of IOPersistence if the field type is IOPersistence.

The code is less than ideal and needs some cleanup and the OrderedCollection/Dictionary stuff needs some serious help.

The project can be found under the title "Automatic Object Storage To MySQL" on SqueakSource or  http://www.squeaksource.com/IOSPersistent/ .

I would love to get some feedback or see if there is any interest in this sort of thing. The implementation in my mind is not important but I think the idea of automatic Object to Relational mapping is.


Thanks
Will
_______________________________________________
Seaside mailing list
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


More information about the Seaside mailing list