I'm trying to retrieve a count of records in a table using SQLite.swift and Swift in a Cocoa macOS application.
All tables can try to get data from SQLite data only two tables is showing
no such table tablename (code:1)
My query for create table…
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…
I want to be able to either set a sorting condition for my SQLite Table or sort it every time a new entry is inserted.
The SQlite docs say to use query.order(expression)
Currently this is what I have:
class SQLiteData {
var fileURL : URL
…
I'm implementing sqlite in my swift project and with update query i am updating some value from table but i am getting syntax error i am not sure why i am getting error.
UPDATE Code
let updateStatementString = "UPDATE CreateInspDrawingDetail SET…
I'm just starting out trying sqlite.swift and databases with swift. I have prepared a database with tables and preloaded with data. I wish to select data and insert data from within the app.
The problem is that I don't understand where (in my…
I use SQLite.swift and after upgrading to Swift 5 an error appears in the library. Please help me rewrite the method.
Error:
'withUnsafeBytes' is deprecated: use `withUnsafeBytes(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R`…
In my application, a Connection object is initialized in my AppDelegate.swift, applicationDidBecomeActive().
How do I pass that Connection object to my ViewController subclass?
EDIT:
As asked by Maddy I am including the code that "opens" the file:
I deleted an app and run it again via Xcode. Before there were no files in the documents directory so I checked and since there were no files I could copy my 32 bytes sqlite file…
I am using SQLite.swift framework for my iOS application. I have DatabaseService class where I create a database connection and perform all CURD operations. I was instantiating this class and creating a connection on each controller but recently I…
I am trying to insert about 10000 data into my database. Check below function for code. It takes about a minute to insert all data. Now I already added block in transaction but do I need to Commit it or it manages automatically. How can I write it…
I am retrieving the data from SQLite to a table view cells, but the data is being retrieved duplicate triple times, means on each data there should be a single cell in which the retrieved data will be. but the current situation is that for each data…
I use SQL.swift but I cannot find a way to select values from multiple tables during a join. My db structure is the following:
airport --* tower --* tower_frequency
An airport can have several control towers and each control tower can have several…
I am reading two different SQLite files and reading the 4th column. In one of the files, the type is REAL and in the other, it's INTEGER.
When I try to extract the value, I am unable to ever determine the type:
for row in try! db.prepare("SELECT *…
How can I create a table with a composite primary key with this library. For example:
CREATE TABLE something (
column1,
column2,
column3,
PRIMARY KEY (column1, column2)
);
The only example I see in the documentation is a primary key on…