[Mono-list] Mono.Data.SqliteClient always report text
as DataTypeName
Julien Sobrier
julien at sobrier.net
Wed Dec 14 01:01:13 EST 2005
Aaron Bockover wrote:
> Internally in sqlite, everything is stored as a string, regardless of
> what type a column was assigned during table creation.
>
> The only way to know the "type" is to parse the table definition from
> the sqlite_master table. This should probably be done for convenience
> inside Mono.Data.SqliteClient.
>
> For instance, run this query:
>
> SELECT sql FROM sqlite_master WHERE name="Tracks";
>
> That will return the SQL used to create the "Tracks" table. You can then
> parse that result to build a map of column names->types.
>
> There is some example code for this in Banshee:
> http://cvs.gnome.org/viewcvs/*checkout*/banshee/src/Database.cs
>
> --Aaron
Thanks a lot, I'll look at it.
More information about the Mono-list
mailing list