On Sat, May 5, 2018 at 4:08 AM, Max Vlasov <max.vla...@gmail.com> wrote:
> On Sat, May 5, 2018 at 1:19 PM, J Decker <d3c...@gmail.com> wrote: > > > https://www.sqlite.org/c3ref/column_blob.html > > > > The sqlite3_column_type() routine returns the datatype code > > > > > Column api is not suitable for me since it relies on the actual data > provided, but I'm the one who calls sqlite3_result_* to provide this. > https://www.sqlite.org/c3ref/value.html sqlite_result_value the valuer type itself has the type. This is the type that would be returned by sqlite_column_types(). If you're serving the data, then you know what the data type is. if you don't you need to store it so you do; and this is outside of sqlite. > > > > > > PRAGMA table_info(table1); > > > > The pragma just returns the type part as it was provided by the virtual > table module with schema data. No conversion or mapping is made. But it > will help be to extract the type part correctly if the provided list > comments for example . > [FieldA] /*This is fieldA */ TEXT, [FieldB] FLOAT.... > > > Something also came up as a solution during the reading of this post. The > query > Select typeof(cast('' as <type>)) > doesn't require any table so I just can replace <type> with a provided > column type and get the best affinity. > But for any unrecognized it will return "integer", but I'd rather have > "text". > > Max > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users