Paul McNett wrote:
Ed Leafe wrote:
On Feb 2, 2006, at 9:59 PM, Echo wrote:
Ok, ignore that. It does not actuly insert the data for MySQL. But it
does for SQLite. Any idea why that is?
PySQLite doesn't populate some of the attributes that are needed
for the getStructureDescription() method. After all, when you create
a new record, Python needs to know the fields and the data types of
each in order to create a representation of that new record, and
PySQLite doesn't provide that information. Perhaps we can look into
coming up with a workaround in dbSQLite.getStructureDescription().
Yep, this is something that is *really needed* and *very badly*. We
actually need to be able to get the full structure of the query passed
from the backend, so we have an idea what the field types are even if
the query returned zero records.
May not be possible (I at least can't think of a way, even for MySQL
which I know really well)... you can always get the types of columns
using DESCRIBE <tablename> but I don't know how to get types of
derived fields as MySQL would have returned them had records been
returned.
And, more importantly, getting SQLite working in this regard as well.
I think the problem is that SQLite doesn't really support datatypes, you
can create columns of any type.
This statement: CREATE TABLE tab( foo bar); work perfectly in SQLite.
Also there is a work around in getStructureDescription using "pragma
table_info()". It just returns I or N as fieldTypes and everything else
as C.
We could extend that to support date and such so dabo can handle the
sqlite data better. For SQLite they'll always be strings. :)
Also didn't Echo say it worked for SQLite but not for MySQL?
adi
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users