Open androidseb25 opened 1 year ago
Is there a way to include the SQLite >3.35.0 version, because I want to use the trigonometric function like sin, cos or acos in a sql query.
At the moment with the latest version of SQLite.swift I get following error:
no such function: acos (code: 1)
A example for the query I use:
SELECT *, ( 6371 * acos ( cos ( radians(LOCATIONLAT) ) * cos( radians( p.p_lat ) ) * cos( radians( p.P_LNG ) - radians(LOCATIONLNG) ) + sin ( radians(LOCATIONLAT) ) * sin( radians( p.p_lat ) ) ) ) AS distance FROM table p where distance < 15.0 ORDER BY distance
it calculates the distance in km between two points.
In my sqlitedatabase browser it works and it use the 3.39.4 version of SQLite.
FYI: the SQLite version of iOS 16.2 is 3.39.5
If you want a specific version of SQLite you'll need to integrate via CocoaPods at the moment.
See https://github.com/stephencelis/SQLite.swift/blob/master/Documentation/Index.md#requiring-a-specific-version-of-sqlite
Build Information
Is there a way to include the SQLite >3.35.0 version, because I want to use the trigonometric function like sin, cos or acos in a sql query.
At the moment with the latest version of SQLite.swift I get following error:
no such function: acos (code: 1)
A example for the query I use:
SELECT *, ( 6371 * acos ( cos ( radians(LOCATIONLAT) ) * cos( radians( p.p_lat ) ) * cos( radians( p.P_LNG ) - radians(LOCATIONLNG) ) + sin ( radians(LOCATIONLAT) ) * sin( radians( p.p_lat ) ) ) ) AS distance FROM table p where distance < 15.0 ORDER BY distance
it calculates the distance in km between two points.
In my sqlitedatabase browser it works and it use the 3.39.4 version of SQLite.
FYI: the SQLite version of iOS 16.2 is 3.39.5