[fdo-internals] FDO RFC 16 - FDO Provider for SQLite
Traian Stanev
traian.stanev at autodesk.com
Wed Apr 23 10:19:27 EDT 2008
> -----Original Message-----
> From: fdo-internals-bounces at lists.osgeo.org [mailto:fdo-internals-
> bounces at lists.osgeo.org] On Behalf Of Frank Warmerdam (External)
> Sent: Wednesday, April 23, 2008 12:54 AM
> To: FDO Internals Mail List
> Subject: Re: [fdo-internals] FDO RFC 16 - FDO Provider for SQLite
>
> Traian Stanev wrote:
> > Yes, so the problem is that the type mapping code had an incomplete
> set of
> > data types -- it assumed that SQLite reports data types that are
> already
> > mapped to SQLite affinities, while in fact it returns whatever was in
> the
> > raw SQL that created the table. In this case, VARCHAR and FLOAT,
> instead of
> > TEXT and REAL respectively. I'm going to add some more types that I
> got off
> > the SQLite documentation, but will still return an invalid value (-1)
> if the
> > type cannot be mapped, in order to catch more type mapping problems
> as we
> > get more sample data. I was tempted to return Int32 if the type
> cannot be
> > mapped, but decided it would be just a tad too reckless to do so.
>
> Traian,
>
> Would it make more sense to treat anything not otherwise recognised as
> text? That is how it is all stored in the database anyways.
That's not how it's stored in SQLite, since version 3 of the database format. It stores BLOBs and numerics in binary.
Said that, mapping all unknown types to String would work as a general solution, since SQLite does automatic type conversion.
Traian
>
> I can see that the types I'm applying may be somewhat perverse. That's
> the
> problem with sqlite being essentially typeless, there is nothing there
> helping
> different software packages use consistent types!
>
> Best regards,
> --
> ---------------------------------------+-------------------------------
> -------
> I set the clouds in motion - turn up | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush | President OSGeo,
> http://osgeo.org
>
> _______________________________________________
> fdo-internals mailing list
> fdo-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-internals
More information about the fdo-internals
mailing list