SQLite
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Installation
SQLite is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SQLite'
USAGE
//Create or switch new database
SQLite.shared.databaseName = "NewDatabaseName"
//Get new pointer to current database
let databasePointer = SQLite.shared.getDB()
//Get current pointer to working database
let currentDatabasePointer = SQLite.shared.db
//Get Current database name
let currentDatabaseName = SQLite.shared.databaseName
//Execute raw SQL Query
SQLite.shared.execute(query: "Your_Raw_SQL_Query")
//Execute and know executed successfully or error occured
let flag = SQLite.shared.execute(queryString: "Your_Raw_SQL_Query")
//Get rows with column name
SQLite.shared.getRowsWithCol(query: "Your_select_query")
//Insert a Row in Table
let entry : = ["Key1":Value1,"Key2":Value2]
let replaceExisting = true
SQLite.shared.insertTable(entry, TableName, replaceExisting)
//Update Row in Table
let entry : = ["Key1":Value1,"Key2":Value2]
let condition = "columnName = 'MyColumn'"
SQLite.shared.insertTable(entry, TableName, condition)
Author
Vivek Kumar, [email protected]
License
SQLite is available under the MIT license. See the LICENSE file for more info.