catchup commit

This commit is contained in:
Jonathan Guthrie 2016-09-30 15:45:55 -04:00
parent 7bdc9635b2
commit 8ede7a64b8
4 changed files with 31 additions and 17 deletions

View File

@ -19,24 +19,33 @@ protocol CRUDProtocol {
open class Connect {
open var datasource = DataSource()
open var credentials = DataSourceCredentials()
open var datasource = DataSource()
open var credentials = DataSourceCredentials()
open var database: String = ""
open var table: String = ""
open var database: String = ""
/// Manually set table
// Convenience shortcut var
open var table: String = ""
/// Last executed statement
public var statement: String = ""
/// Last executed statement
public var resultCode: PerfectCRUDError = .noError
public init() {}
public init(_ ds: DataSource,
host: String,
username: String = "",
password: String = "",
port: Int = 0) {
host: String,
username: String = "",
password: String = "",
port: Int = 0) {
self.datasource = ds
self.credentials = DataSourceCredentials(host: host, port: port, user: username, pass: password)
}
//
// public func select() -> String {
// return "selected"

View File

@ -14,9 +14,8 @@ public struct DataSourceCredentials {
public var username: String = ""
public var password: String = ""
public init() {
// empty
}
public init() {}
public init(host: String, port: Int = 0, user: String = "", pass: String = "") {
self.host = host
self.port = port

View File

@ -9,6 +9,8 @@
import Foundation
open class PerfectResultSet {
var rows: [PerfectRow] = [PerfectRow]()
var cursorData: PerfectCRUDCursor = PerfectCRUDCursor()
public var rows: [PerfectRow] = [PerfectRow]()
public var cursorData: PerfectCRUDCursor = PerfectCRUDCursor()
public init() {}
}

View File

@ -22,6 +22,10 @@ open class PerfectRow {
var idString = ""
fileprivate var idType: idTypeList = .Int
public var data = Dictionary<String, Any>()
public init() {}
public func id(_ val: Int) {
idType = .Int
idInt = val
@ -46,7 +50,7 @@ open class PerfectRow {
}
}
public func parse(_ rows: [[String: Any]]) {
// parse rows
}
// public func parse(_ rows: [[String: Any]]) {
// // parse rows
// }
}