24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
+
-
-
+
+
-
+
|
@end
OF_APPLICATION_DELEGATE(Tests)
@implementation Tests
- (void)applicationDidFinishLaunching: (OFNotification *)notification
{
OFIRI *IRI = [OFIRI fileIRIWithPath: @"tests.db"];
OFFileManager *fileManager = [OFFileManager defaultManager];
SL3Connection *conn;
SL3PreparedStatement *stmt;
if ([fileManager fileExistsAtPath: @"tests.db"])
[fileManager removeItemAtPath: @"tests.db"];
if ([fileManager fileExistsAtIRI: IRI])
[fileManager removeItemAtIRI: IRI];
conn = [SL3Connection connectionWithPath: @"tests.db"];
conn = [SL3Connection connectionWithIRI: IRI];
[conn executeStatement: @"CREATE TABLE test (a INT, b TEXT, c BLOB)"];
stmt = [conn prepareStatement:
@"INSERT INTO test (a, b, c) VALUES ($a, $b, $c)"];
[stmt bindWithArray: [OFArray arrayWithObjects:
[OFNumber numberWithInt: 5],
|