Differences From Artifact [e494e1ab6f]:
- File test.m — part of check-in [6d068f6ae7] at 2012-10-04 22:18:32 on branch trunk — Exclude fields that are NULL from the result. (user: js, size: 1123) [annotate] [blame] [check-ins using]
To Artifact [f9e8525602]:
- File
test.m
— part of check-in
[d2fe40f160]
at
2012-10-05 20:17:45
on branch trunk
— Nicer API.
-[executeCommand:parameters:] is now a variadic function instead of
taking an array as argument. (user: js, size: 1221) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
26 27 28 29 30 31 32 | [connection executeCommand: @"CREATE TABLE test (" @" id integer," @" name varchar(255)," @" content text" @")"]; [connection executeCommand: @"INSERT INTO test (id, name, content) " @"VALUES($1, $2, $3)" | | | > > > | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | [connection executeCommand: @"CREATE TABLE test (" @" id integer," @" name varchar(255)," @" content text" @")"]; [connection executeCommand: @"INSERT INTO test (id, name, content) " @"VALUES($1, $2, $3)" parameters: @"1", @"foo", @"Hallo Welt!", nil]; [connection executeCommand: @"INSERT INTO test (id, content) " @"VALUES($1, $2)" parameters: @"2", @"Blup!!", nil]; result = [connection executeCommand: @"SELECT * FROM test"]; of_log(@"%@", result); of_log(@"JSON: %@", [result JSONRepresentation]); result = [connection executeCommand: @"SELECT COUNT(*) FROM test"]; of_log(@"%@", result); [OFApplication terminate]; } @end |