<p dir="ltr">How about querying the sqlite_master table to find the data type?  And why not use the constraints found in this query to set up the qgis relations?</p>
<p dir="ltr">-Bob (aka cgs_bob on freenode)</p>
<div class="gmail_quote">On May 27, 2014 6:04 AM, "Régis Haubourg" <<a href="mailto:regis.haubourg@eau-adour-garonne.fr">regis.haubourg@eau-adour-garonne.fr</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hugo Mercier wrote<br>
> Or<br>
>> calculated fields in view can't be explicitly cast, so QGIS should have<br>
>> to<br>
>> guess data type based on a data scan (a major unadressed issue of sqlite)<br>
><br>
> Hmmm I wasn't aware of this limitation in SQLITE views :(<br>
<br>
Yes, SQLITE does dynamic typing, so user or provider has to scan values to<br>
guess the right type.<br>
Here is a sqlite topic on that [0]<br>
And here my initial post in qgis list [1]<br>
<br>
[0]<br>
<a href="http://sqlite.1065341.n5.nabble.com/Computed-columns-in-VIEWs-return-NULL-but-should-be-able-to-be-typed-Any-ideas-td56769.html#a56770" target="_blank">http://sqlite.1065341.n5.nabble.com/Computed-columns-in-VIEWs-return-NULL-but-should-be-able-to-be-typed-Any-ideas-td56769.html#a56770</a><br>

<br>
[1]<br>
<a href="http://osgeo-org.1560.x6.nabble.com/Spatialite-can-t-type-fields-of-a-view-td5058436.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Spatialite-can-t-type-fields-of-a-view-td5058436.html</a><br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/have-aggregate-window-expressions-ever-been-discussed-tp5142215p5142714.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/have-aggregate-window-expressions-ever-been-discussed-tp5142215p5142714.html</a><br>

Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>