[Seaside] Seaside Mysql Question

David Mitchell david.mitchell at gmail.com
Mon Dec 24 14:54:01 UTC 2007

Thanks Keith,

I wasn't looking for much (I don't even have update rights to the
database). I'm just doing some reporting.

I downloaded the MySQL driver off SqueakMap and it worked after I
stubbed in some asByteArray and asInteger on Integer and ByteArray.

Right now, I'm using Seaside for HTML generation. I've got a top level
component to match my the structure of our companies HTML so that the
CSS flows right. Then I have a component flow that basically consists
of home page (list of reports), the links fire off some SQL and load
the results into a component that shows a table. After I got there, I
thought, someone has probably already done this, and that's when I
found your old post.

I'll check out RDB, even though I'm sure it is overkill for me. I
don't have any intent to map the database to an object model.



On Dec 21, 2007 3:37 PM, Keith Hodges <keith_hodges at yahoo.co.uk> wrote:
> Chris Cunnington wrote:
> > Hi David,
> >
> > I'm going to throw out a bunch of observations here, and if anyone wants to
> > have a different opinion, I'm happy to hear it.
> >
> >
> Dear David,
> I think Chris doth speaketh to sooneth.
> The MySQL driver is available on squeaksource at http://www.squeaksource.com
> I have heard rumours of GLORP support for MySql, but I haven't obtained
> any code as yet.
> In the meantime I have been using MySql with Magritte and there is a
> package in http://mc.lukas-renggli.ch/magritteadons called 'RDB'. Ok its
> not glorp, but it is serving me quite well.
> This includes a reader/writer visitor for coercing data in and out of
> databases (over and above that provided by the driver). This is useful
> for saving any of your custom data types, e.g. "price with currency
> code", and also simple Arrays/Sets of strings. i.e. The driver doesnt
> have enough information about the datatype to know whether it is just
> retrieving a string, or some other datatype written out as a string.
> Magritte descriptions on the other hand do give this information. So the
> database access classes MYSQL40 and MYSQL41 use these coercion
> reader/writers.
> For using MySql with seaside, there is a WAMysqlConfiguration for
> setting the database/user/pass in seaside/config, and a class WAMySql
> which uses the current application's settings. So far I have not found
> it necessary to keep a session open per seaside session so there is no
> SessionHelper for MySql as yet.
> There are also some base classes MAModel, MANumberedModel, based upon
> work by Damien I think, which can realize objects out of a database
> based upon Magritte descriptions. If your column names do not match the
> object attribute names then define fieldName: in the description.
> OneToOne relationships are supported, so if you realize an object with a
> one to one relationship, its relation is also realised. You have to
> specify the "joinField: fieldName" and "joinTo: fieldName" for the one
> to one magritte description.
> This package may be lacking sufficient examples as to how to use it, I
> can provide you with some if you wish, just ask
> Keith
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list