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
1
vote
0 answers

Use of substring function with length parameter filled from column value

I want to create SELECT statement: SELECT substr(fileNameWithSuffix, 1, length(fileNameWithSuffix) - length(suffix)) AS fileName FROM someTable However SQLite.swift seems to only allow fixed length parameter in substring. Declaration of substring…
Joey
  • 164
  • 9
1
vote
0 answers

SQLite.swift: Error during INSERT

I try to use the SQLite.swift Lib, but I'm getting an error during an INSERT: Error Domain=SQLite.Result Code=0 "(null)" I've setup a Database class (DBContact is a simple struct): import SQLite class SQLiteDatabase { var db : Connection; let…
fillibuster
  • 698
  • 4
  • 16
  • 33
1
vote
0 answers

iOS show error when connect to SQLite database fails

When my iOS app starts, I want to connect to a local SQLite database using SQLite.swift and then show the user a list of items that are stored in the database. Making the database connection can throw. If connecting fails then I want to show the…
Ted Henry
  • 1,442
  • 1
  • 14
  • 34
1
vote
1 answer

SQLite.swift and Swift 3 "Ambiguous reference to member ==" in join

I'm developping an iOS application which use an SQLite database and I use the SQLite.swift library (https://github.com/stephencelis/SQLite.swift). I'm trying to migrate my application in Swift 3, so I changed my library to use the branch…
Dorian
  • 761
  • 3
  • 11
  • 28
1
vote
2 answers

Cannot import SQLite for SQLite Swift wrapper

I followed the SQLite.Swift manual installation process exactly (https://github.com/stephencelis/SQLite.swift), but a red warning appears at "import SQLite". OSX (10.11.6) XCode 7.3.1 Question Do I need to create and include a header file? Reference…
Yuichiro
  • 11
  • 4
1
vote
0 answers

How to get query execution time in sqlite.swift?

So SQLite.swift is quite awesome. I have it tracing my SQL queries using: db.trace { SQL in print(SQL) } It works fine. However, I'd like to add SQL execution time as well on the output. Any ideas how to do that?
maresa
  • 571
  • 6
  • 15
1
vote
0 answers

SQlite Swift unexpected result group

I am using Swift SQLite. I want to retrieve 'flights' in groups switch their 'departureDate' if let flightQuery = self.flightQuery, let dataBase = self.db { let flightGroupByDepartureDate = flightQuery.group(self.departureDate) …
1
vote
1 answer

Fire an action once a transaction ends

I'm using Stephen Celis iOS lib for handling SQLite3 databases, here is the github link. Taking the example on the git : try db.transaction { let rowid = try db.run(users.insert(email <- "betty@icloud.com")) try db.run(users.insert(email <-…
Super Guillaume
  • 87
  • 1
  • 11
1
vote
0 answers

sqlite.swift linked library or also embedded?

I manually installed the SQLite.swift library in my project, following the instructions in the documentation. But there the library will only be linked. It's running fine in the emulator and I am able to upload it to iTunes connect. When I want to…
Arnold Schmid
  • 163
  • 12
1
vote
0 answers

Joining from multiple databbases with SQLite.Swift

Is there a way to join tables from more than two SQLite databases with SQLite.Swift? The documentation only has examples from the same database. Note to the duplicate gurus: This is not about how to join tables in SQlite from different databases.…
Penman
  • 129
  • 8
1
vote
0 answers

Insert fails on first table on iPhone 6 iOS 9.2

I am using 5 SQLite.swift tables in my code. The first table is used to store location data : DataModel: typealias Location = ( latitude: Double, longitude: Double, timestamp: String, speed: Double, direction:…
Ashish M
  • 11
  • 1
1
vote
1 answer

Header "/usr/include/sqlite3.h" not found

Just installed SQLite.swift from cocoapods in my Xcode project and I get an error when trying to build stating Header "/usr/include/sqlite3.h" not found. Therefore I get an error stating could not build Objective-C module 'SQLite3'. Am I just doing…
Zane Campbell
  • 150
  • 1
  • 12
1
vote
1 answer

iOS: How to copy pre-seeded database at the first running app with SQLite.swift to writeable location?

I had the previous question here about database location. What different between store database in different locations in iOS? I'm confused in copying pre-seeded database to the writable location. Now, every time I run and build my app, the in-use…
TomSawyer
  • 3,711
  • 6
  • 44
  • 79
1
vote
0 answers

no such module 'SQLite' from playground

I have downloaded SQLite.swift and get this error: Playground execution failed: /var/folders/43/nc3kf6y17dbfdn14crfmcdjh0000gn/T/./lldb/2060/playground2.swift:1:8: error: no such module 'SQLite' import SQLite I also note that SQLite.swift has a…
Mark80
  • 55
  • 1
  • 7
1
vote
1 answer

SQLite.swift - Cannot subscript a value of type Row. Swift 2

This method was working while I was using Swift 1.2. But now, I had to update to Xcode and I had to switch my language to Swift 2. This is the method from swift 1.2 which I used well ; static func findById(idToFind : Int64) -> T? { let query =…
letitbefornow
  • 427
  • 6
  • 20