Skip to content

Support for SQLite 3.35.0 or above #1181

Open
@androidseb25

Description

@androidseb25

Build Information

  • SQLite.swift version: 0.14.1 -> master branch
  • Xcode: 14.2 and OS X: 16.2
  • Installed the lib with Swift Package manager

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions