Dear All,
I have been using magritte with MySql for a while. Today I discovered
that something more than basic type coercion is needed for writing
values described by MASingleOptionDescription's to the database, since
the type is defined its #reference: .
This led me to finally understand why MAStringWriter and MAStringReader
are implemented as visitors.
So... I figured that the task of coercing data types into and out of
databases is going to be a common problem, and so I have begun a
framework for doing this (properly?).
http://source.lukas-renggli.ch/magritteaddons2 -- since magritteaddons
is still inaccessible (lukas?)
The basic scheme so far is to define visitor based reader/writers for
database interfaces to use for coercion.
These reader/writers are not instanciated for every value read/written,
but may last the lifetime of a query (or longer) according to how the db
interface makes use of them.
For efficiency they also cache a single string reader and a writer for
frequent re-use.
I have also included a MAPriceDescription for good measure.
I have got a fair bit of higher level stuff working with MySQL, but I
suspect that it is not yet generic enough to be part of this framework yet.
I have also posted my version of the MySql Driver which has been hacked
up a bit to handle both mysql versions > 4.1 and < 4.1
If anyone finds this useful or would like to contribute their infinite
db know-how please let me know.
best regards
Keith
_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki