Overview
Comment: | Adjust to ObjFW changes |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
0af9225d647a95b3135fc711065584dc |
User & Date: | js on 2021-04-29 22:36:08 |
Other Links: | manifest | tags |
Context
2021-04-29
| ||
22:46 | Fix method name mismatch check-in: 770a096b55 user: js tags: trunk | |
22:36 | Adjust to ObjFW changes check-in: 0af9225d64 user: js tags: trunk | |
2020-05-31
| ||
20:11 | Update URL and e-mail check-in: 6417eb405d user: js tags: trunk | |
Changes
Modified src/PGConnection.h from [959beb709d] to [ae7a76644d].
︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | + + - + - - - + + | #import <ObjFW/ObjFW.h> #import "PGResult.h" OF_ASSUME_NONNULL_BEGIN typedef OFDictionary OF_GENERIC(OFString *, id) *PGRow; @interface PGConnection: OFObject { PGconn *_connection; OFDictionary OF_GENERIC(OFString *, OFString *) *_parameters; } @property (nonatomic, copy) OFDictionary OF_GENERIC(OFString *, OFString *) *parameters; - (void)connect; - (void)reset; - (void)close; - (nullable PGResult *)executeCommand: (OFConstantString *)command; - (nullable PGResult *)executeCommand: (OFConstantString *)command |
Modified src/PGConnection.m from [14ce011f15] to [44eb09f94d].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - + - | #import "PGResult.h" #import "PGResult+Private.h" #import "PGConnectionFailedException.h" #import "PGCommandFailedException.h" @implementation PGConnection |
︙ | |||
119 120 121 122 123 124 125 | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | - + - - - + + - + - - - - + - - + | int argsCount; va_start(args, parameter); va_copy(args2, args); for (argsCount = 1; va_arg(args2, id) != nil; argsCount++); |
︙ | |||
201 202 203 204 205 206 207 | 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - + - - + - + - + - | [command appendString: key]; i++; } [command appendString: @") VALUES ("]; |
Modified src/PGResult.m from [95d2097d1f] to [0b8c7e69a5].
︙ | |||
57 58 59 60 61 62 63 | 57 58 59 60 61 62 63 64 65 66 | - + - | } - (id)objectAtIndex: (size_t)index { if (index > PQntuples(_result)) @throw [OFOutOfRangeException exception]; |
Modified src/PGResultRow+Private.h from [11616d090c] to [7e2807226e].
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 | - + - - + - | */ #import "PGResultRow.h" OF_ASSUME_NONNULL_BEGIN @interface PGResultRow () |
Modified src/PGResultRow.m from [d8c72a2db5] to [007cd2722f].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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 | - - + + - - + + - - + + - + - - + - - + - - + - | switch (PQftype(res, column)) { case 16: /* BOOLOID */ if ([string isEqual: @"t"]) return [OFNumber numberWithBool: YES]; else return [OFNumber numberWithBool: NO]; case 21: /* INT2OID */ |
︙ | |||
132 133 134 135 136 137 138 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | - + | - (OFEnumerator *)objectEnumerator { return [[[PGResultRowObjectEnumerator alloc] initWithResult: _result row: _row] autorelease]; } |
︙ | |||
166 167 168 169 170 171 172 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - + - | state->mutationsPtr = (unsigned long *)self; return j; } @end @implementation PGResultRowEnumerator |
︙ |
Modified tests/tests.m from [68a20488bf] to [7a8b6cc45d].
︙ | |||
65 66 67 68 69 70 71 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - - + + - + - + | [OFNumber numberWithInt: 2], [OFNumber numberWithBool: true], nil]; [_connection insertRow: [OFDictionary dictionaryWithKeysAndObjects: @"content", @"Hallo!", @"name", @"foo", nil] intoTable: @"test"]; result = [_connection executeCommand: @"SELECT * FROM test"]; |