I am trying to create a project that will sync data from an online database.
I have 4 files to take care of the whole process:
dbConnection.swift
createTables.swift
dropAllTables.swift
updateDatabase.swift
I am running into a problem when trying…
I've been working with Sqlite.Swift for quite a while now and I'm stuck.
I'm trying to get an Int out of the .count of only the amount of rows containing the String value "1" in the column "yes or no".
I've been using the following function to…
I am using SQLite.swift library.
I have several Expressions,
let idColumn = Expression("id")
let nameColumn = Expression("name")
I would like to have a dictionary host them, So, I did:
let columns: [String: Expression] = [
…
I am using SQLite.swift library.
I have defined a expression:
let id = Expression("id")
I have a variable:
let num: Int = 1
Then, in update statement I do filtering:
let users = Table("User")
// compiler error: // Binary operator '=='…
Trying to get query results into an array. The example from the documentation shows this working...
let statement = try db.prepare(query)
var results = Array(statement)
...however when I try to compile this I get...
Ambiguous use of 'init'
... for…
I've got a sqlite table with sub_id's, these are stored as strings. When I order with this column, I get my data ordered like this:
1, 10, 13, 16, 2, 23, etc
How can I order them numerically?
My code:
var id = Expression("id")
let m_id =…
Experienced developer here... but somewhat new to Swift and definite newbie with SQLite.swift...
I am trying to get my hands around using SQLite in an iOS app - so I created a simple app to make sure I got the basics down... Everything was going…
I am using the sqlite.swift library found here
Below is the code I am using to filter results:
.filter(mdm[assetTag] != "ipad" && location == facility && [tagArray].contains(appversion))
I am getting the following error for the .contains…
I've defined an enum and made it conform to Value like so:
enum Name: Int {
//cases
}
extension Name: Value {
static var declaredDatatype: String {
return Int.declaredDatatype
}
static func fromDatatypeValue(_ intValue: Int)…
I have integrated SQLite.swift framework in one of my swift project and everything was working fine until i added the below query. After adding the below query project is taking too long to build. I waited for 30 mins but still project is n't…
I have a query built like this:
let query = devices.select(assetTag)
.order(assetTag.desc)
.limit(5, offset: 1)
I just do not know which function to use to run it. Do I run it like this:
db.execute(query)
I have an application that uses SQLite.swift to save a list of shopping items. It works quite well, and is deeply rooted in the app. But I've been getting asked to make a WatchOS app that has the same items on your wrist.
My issue with this, is that…
How can I check the last row in this loop below. Im using SQlite.swift in order to cycle through all the rows in the table. When I hit the last row, I want to do something.
for data in try dbConnection.prepare(tableName) {
if…
as the example :
for user in try db.prepare(users.select(id, email)) {
print("id: (user[id]), email: (user[email])")
// id: 1, email: alice@mac.com
}
// SELECT "id", "email" FROM "users"
but I want know if possible use name but expression…
platform :ios, ’10.1’
target 'SwiftDemo' do
use_frameworks!
pod 'SDWebImage', '~> 4.0.0-beta2'
pod 'AFNetworking', '~> 3.1.0'
pod 'MJRefresh', '~> 3.1.12'
pod 'SQLite.swift', '~> 0.11.3'
end
this is my podfile, and after i put SQLite.swift into my…