Questions tagged [sqlite.swift]

A third-party, type-safe, Swift-language layer over SQLite.

A third-party, type-safe, Swift-language layer over SQLite.

Related tags:

,

References:

252 questions
2
votes
1 answer

SQLite.swift build error "Module file's minimum deployment target is ios8.3 v8.3"

I have upgraded OS X from 10.9 to 10.10 in order to be able to use Xcode 6.3 - current Version is 6.3 (6D570). When I created my project with Xcode 6.2 I successfully imported SQLite.swift as described in the documentation and everything was…
maddob
  • 989
  • 1
  • 12
  • 29
2
votes
1 answer

Cannot find an overload for 'contains' that accepts an argument list of type '([Int], Expression)'

I use SQLite.swift I tried the expression: userTable.filter(contains([1, 2, 3, 4, 5], entryId)) from the example. But I got the following error: Cannot find an overload for 'contains' that accepts an argument list of type '([Int],…
Michael
  • 32,527
  • 49
  • 210
  • 370
2
votes
2 answers

How to open database encrypted with sqlcipher

Could anyone post code sample of how to open sqlcipher database? I guess that we need to call the key function in some way.
Dev77
  • 21
  • 1
  • 2
1
vote
0 answers

Cannot Import SQLite for SQLite Swift Wrapper in Library Target

I read the similar question @ Cannot Import SQLite for SQLite Swift Wrapper but it wasn't quite my scenerio. Xcode 14.3.1 I started a macOS Library project in Xcode. I added the SQLite.xcodeproj file to my project. However, instructions then tell…
ccampj
  • 665
  • 1
  • 8
  • 18
1
vote
0 answers

How to convert Sqlite.swift Binding to a primitive Swift type?

How can I get a primitive Swift type from a SQLite.swift Binding, I have this sample: for row in try db.prepare("select * from table") { let t = row[0]! as Int64 It shows me an error 'any Binding' is not convertible to…
egor10_4
  • 331
  • 2
  • 9
1
vote
2 answers

How to delete column in SQLite.swift

I am trying to do a SQLite.swift (v 0.12.2) migration which will delete column. But I can't found any method in documentation for that. I see only addColumn, but no any for deletion. How is it designed to work to Delete Column? The only way I've…
bodich
  • 1,708
  • 12
  • 31
1
vote
1 answer

Dynamic Filter in Sqlite.swift to check if a column is not null

I need some help in understanding the following problem. I have the need for a dynamic filter (trying to not duplicate the queries for different scenarios). I have already found that I can create a dynamicFilter = Expression(value: true) and…
Maverick2805
  • 188
  • 2
  • 9
1
vote
0 answers

Xcode Previews fail with: "missing required module 'SQLiteObjc'"

Although I can compile and run my project using SQLite.swift, I can't preview views that are in a local package. An issue was recently fixed for Carthage installs: https://github.com/stephencelis/SQLite.swift/issues/1150 I tried adding:…
Mozahler
  • 4,958
  • 6
  • 36
  • 56
1
vote
0 answers

Creating Repository pattern for use with local .SQLite db in Swift

I am building a SwiftUI app that pulls information from a local .SQLite database (using the SQLite.swift wrapper from https://github.com/stephencelis/SQLite.swift/blob/master/Documentation/Index.md). I need to build a repository that sits between…
1
vote
3 answers

SQLite.swift and M1 chip and simulator

I have a project where I use SQLite.swift. Recently I got a MacBook Pro with a M1 chip. After that the project runs fine on a device but when I try to run on simulator I get this error message from Xcode: Could not find module 'SQLite' for target…
Horatiu
  • 151
  • 2
  • 12
1
vote
0 answers

Select query With Order Localized Caharacters

I use Sqlite on Android with Android Studio. Select * From MyTable ORDER BY MyStringField COLLATE LOCALIZED returns correct order with local characters. On ios i use Xcode 13 and swift.sqlite But there is no LOCALIZED option on queries. There is…
1
vote
0 answers

Sqlite.swift: how I can use column aliasing(AS statment) after join for decoding?

I want to decode the result of query to my model that I used it in my remote request but after join i cant decode with codingKeys because sqlite.swift replaces the double-cotation and it can't find the column name my code to get data from sqlite…
Morteza
  • 11
  • 1
  • 4
1
vote
1 answer

How to execute the SQL where In query in swift and bind the params in the statement?

Below I am sharing my existing code which I have used for executing the where IN condition but now I am stuck in how to pass the values in the request. public func getName(list: [String], class: String) -> [String] { let queryStatementString =…
Yatish Agrawal
  • 452
  • 5
  • 15
1
vote
0 answers

How to add column to Sqlite.swift

let tango_id = Expression("tango_id") let e_score = Expression("e_score") let interval = Expression("interval") let next_revision_date = Expression("next_revision_date") let bookmark =…
alamodey
  • 14,320
  • 24
  • 86
  • 112
1
vote
1 answer

Conversion errors from Swift 3.0 to Swift 4.2 at SQLitt.Swift unregonized token

My current code is written with Swift 3 ,I tried to change Swift 4.2 via Xcode10.1. SQLite is crashing on changes version and working correct on old code. I'm trying to retrieve a count of records in a table using SQLite.swift and Swift in a Cocoa…
Sabai Phoo
  • 358
  • 1
  • 4
  • 20