File tree 5 files changed +10
-7
lines changed
5 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ func withBlob(block: Blob -> ()) {
154
154
let length = 1
155
155
let buflen = Int ( length) + 1
156
156
let buffer = UnsafeMutablePointer < ( ) > . alloc ( buflen)
157
- memcpy ( buffer, " 4 " , UInt ( length) )
157
+ memcpy ( buffer, " 4 " , length)
158
158
block ( Blob ( bytes: buffer, length: length) )
159
159
buffer. dealloc ( buflen)
160
160
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import Foundation
27
27
/// A connection (handle) to a SQLite database.
28
28
public final class Database {
29
29
30
- internal var handle = COpaquePointer . null ( )
30
+ internal var handle : COpaquePointer = nil
31
31
32
32
/// Whether or not the database was opened in a read-only state.
33
33
public var readonly : Bool { return sqlite3_db_readonly ( handle, nil ) == 1 }
Original file line number Diff line number Diff line change @@ -173,6 +173,10 @@ public extension Database {
173
173
174
174
}
175
175
176
- private func asValue< A: Value > ( value: Binding ? ) -> A {
176
+ private func asValue< A: Value > ( value: Binding ) -> A {
177
177
return A . fromDatatypeValue ( value as! A . Datatype ) as! A
178
178
}
179
+
180
+ private func asValue< A: Value > ( value: Binding ? ) -> A {
181
+ return asValue ( value!)
182
+ }
Original file line number Diff line number Diff line change @@ -768,7 +768,7 @@ public struct Row {
768
768
}
769
769
public func get< V: Value > ( column: Expression < V ? > ) -> V ? {
770
770
func valueAtIndex( idx: Int ) -> V ? {
771
- if let value = values [ idx] as? V . Datatype { return ( V . fromDatatypeValue ( value) as! V ) }
771
+ if let value = self . values [ idx] as? V . Datatype { return ( V . fromDatatypeValue ( value) as! V ) }
772
772
return nil
773
773
}
774
774
@@ -821,8 +821,7 @@ public struct QueryGenerator: GeneratorType {
821
821
private lazy var columnNames : [ String : Int ] = {
822
822
var ( columnNames, idx) = ( [ String: Int] ( ) , 0 )
823
823
column: for each in self . query. columns ?? [ Expression < ( ) > ( literal: " * " ) ] {
824
- // FIXME: rdar://19769314 // split(each.expression.SQL) { $0 == "." }
825
- let pair = split ( each . expression. SQL, { $0 == " . " } )
824
+ let pair = split ( each . expression. SQL) { $0 == " . " }
826
825
let ( tableName, column) = ( pair. count > 1 ? pair. first : nil , pair. last!)
827
826
828
827
func expandGlob( namespace: Bool ) -> Query -> ( ) {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ internal let SQLITE_TRANSIENT = sqlite3_destructor_type(COpaquePointer(bitPatter
28
28
/// A single SQL statement.
29
29
public final class Statement {
30
30
31
- private var handle = COpaquePointer . null ( )
31
+ private var handle : COpaquePointer = nil
32
32
33
33
private let database : Database
34
34
You can’t perform that action at this time.
0 commit comments