Overview
Comment: | Add support for retrieving columns |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
727a6838a567ab678c28cb0dfc2b95aa |
User & Date: | js on 2020-10-01 23:43:39 |
Other Links: | manifest | tags |
Context
2020-10-01
| ||
23:53 | SL3PreparedStatement: Add -[row{Array,Dictionary}] check-in: 7a52167702 user: js tags: trunk | |
23:43 | Add support for retrieving columns check-in: 727a6838a5 user: js tags: trunk | |
23:20 | Add initial tests check-in: bda6d49813 user: js tags: trunk | |
Changes
Modified src/SL3PreparedStatement.h from [be4fe62381] to [b2196c1017].
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | + + + - + | sqlite3_stmt *_stmt; } - (void)bindWithArray: (OFArray *)array; - (void)bindWithDictionary: (OFDictionary OF_GENERIC(OFString *, id) *)dictionary; - (void)clearBindings; - (id)objectForColumn: (size_t)column; - (size_t)columnCount; - (OFString *)nameForColumn: (size_t)column; |
Modified src/SL3PreparedStatement.m from [a1e7e17bb0] to [fdeb582274].
︙ | |||
157 158 159 160 161 162 163 | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if (code != SQLITE_OK) @throw [SL3ClearBindingsFailedException exceptionWithStatement: self errorCode: code]; } |
︙ |
Modified tests/Tests.m from [333e97107e] to [5f59d41afd].
︙ | |||
59 60 61 62 63 64 65 66 67 68 69 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | [stmt bindWithDictionary: [OFDictionary dictionaryWithKeysAndObjects: @"$a", [OFNumber numberWithInt: 7], @"$b", @"Test", @"$c", [OFData dataWithItems: "xyz" count: 3], nil]]; [stmt step]; stmt = [conn prepareStatement: @"SELECT * FROM test"]; for (size_t i = 0; [stmt step]; i++) { OF_ENSURE([stmt columnCount] == 3); OF_ENSURE([[stmt nameForColumn: 0] isEqual: @"a"]); OF_ENSURE([[stmt nameForColumn: 1] isEqual: @"b"]); OF_ENSURE([[stmt nameForColumn: 2] isEqual: @"c"]); switch (i) { case 0: OF_ENSURE([[stmt objectForColumn: 0] isEqual: [OFNumber numberWithInt: 5]]); OF_ENSURE([[stmt objectForColumn: 1] isEqual: @"String"]); OF_ENSURE([[stmt objectForColumn: 2] isEqual: [OFData dataWithItems: "abc" count: 3]]); break; case 1: OF_ENSURE([[stmt objectForColumn: 0] isEqual: [OFNumber numberWithInt: 7]]); OF_ENSURE([[stmt objectForColumn: 1] isEqual: @"Test"]); OF_ENSURE([[stmt objectForColumn: 2] isEqual: [OFData dataWithItems: "xyz" count: 3]]); break; default: OF_ENSURE(0); } } [OFApplication terminate]; } @end |