I'm looking to build an iOS hybrid application that also utilizes an Apple Watch application. The watchOS app collects Altimeter data to be stored, and that's it. I was thinking of using this plugin since the watchOS portion is written in Swift. I…
I updated sqlite.swift to version 0.11.4, and my compiler repots an error when I create index including two columns.
Before I was using command
try db.run(table.createIndex([column1, column2], unique: true, ifNotExists: true))
After update, it…
Is it possible to use sqlite.swift from multiple threads (read/write same table). I tried to determine it from from build setting - but did not found SERIALIZED, MULTITHREAD or THREADSAFE words.
Does it use original sqlite3 C library under the hood?…
I'm attempting a query to get the latest N messages in a particular conversation from a table of messages. I think this is the correct sql:
select * from
(select * from messages where convoId = to order by timestamp DESC limit 10)
order by timestamp…
I have my query set as such:
let query = devices.count
And in order to print the results I have the following:
let results = try! db.prepare(query)
for items in results
{
print (items)
}
The output…
I tried to create a expression like this
let performedDate = Expression("strftime('%Y-%m-%d', performedDate)")
and then compare with another string using filter method.
But the generated SQL is
"strftime('%Y-%m-%d', performedDate)" =…
Please note that this question ONLY relates to the popular SQLite.swift library, stephencelis/SQLite.swift
With SQLite.swift you can
let a = Expression("a")
let b = Expression("b")
and so on. But how do you
select a.x, a.y,…
I am new to iOS with android background. and after quite sometime searching how to persist data for my project I chose to use SQLite.swift Library by stephencelis. Now, I want to do a simple Table creation:
CREATE TABLE IF NOT EXISTS TableName…
Sorry that I can't post any code but I don't even know where to start trying to code this statement using SQLite.swift, I have searched and searched but not found anything that could help:
Edit: (I am trying to avoid RAW SQL but if no option will…
The following code works perfectly and I get exactly what I need, but I'm curious if there is a better way to return a joined table. If you look below, how much code I need to write for the joined "Address" table. I was hoping someone can confirm…
I have this class with some optional properties:
class Address {
var Id: Int64
var AddressType: Int64
var AddressStatus: Int64
var Address1: String?
var Address2: String?
var City: String?
var State: String?
var Zip:…
Is it possible to create an array of column expressions using SQLite.swift?
static let COLUMN_PARTNER_ID = Expression(COLUMN_NAME_PARTNER_ID)
static let COLUMN_COMPANY_ID = Expression(COLUMN_NAME_COMPANY_ID)
static let COLUMN_USER_ID…
I am trying to use SQLite.swift sample code but it is throwing an error.
First step I have done is to install it using cocoapods and it was successful. Then I have tried to test it in my app delegate where I declare import SQLite and I have added…
I use SQLite for my persistent store.
I use a dictionary based off the primary key for an in-memory store: var localContext = [String: GrandLite]().
I use the function below to retrieve an object from the dictionary, or from the database and then…
I have managed to install SQLite.swift (0.18.1) using the "Carthage approach".
I can "import SQLite" and do some other stuff, but when I try to open a database, using the following code:
let db = try Connection("~/db.sqlite3")
and run my program…