File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -379,11 +379,15 @@ open class SQLite: SQLiteType {
379379
380380 while sqlite3_step ( sqlStatement) == SQLITE_ROW {
381381 rowValues = SQLValues ( [ ] )
382- for (index, value) in table. columnTypes. enumerated ( ) {
382+ for (index, value) in table. columnTypes. enumerated ( ) {
383383
384384 let index = Int32 ( index) // column serial number, should start with 0
385385
386386 // Check for data types of returned values
387+ guard sqlite3_column_type ( sqlStatement, index) != SQLITE_NULL else {
388+ rowValues. append ( ( value. type, nil ) )
389+ continue
390+ }
387391 switch value. type {
388392 case . INT:
389393 let intValue = sqlite3_column_int64 ( sqlStatement, index)
@@ -463,7 +467,6 @@ open class SQLite: SQLiteType {
463467 }
464468 }
465469
466- /// Returns the id of the last row inserted
467470 public func getLastInsertID( ) -> Int {
468471 return Int ( sqlite3_last_insert_rowid ( dbPointer) )
469472 }
You can’t perform that action at this time.
0 commit comments