10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
@end
OF_APPLICATION_DELEGATE(Test)
@implementation Test
- (void)applicationDidFinishLaunching
{
PGResult *result;
connection = [[PGConnection alloc] init];
[connection setParameters:
[OFDictionary dictionaryWithKeysAndObjects: @"user", @"js",
@"dbname", @"js", nil]];
[connection connect];
[connection executeCommand: @"DROP TABLE IF EXISTS test"];
[connection executeCommand: @"CREATE TABLE test ("
@" id integer,"
@" name varchar(255),"
@" content text,"
|
>
>
|
|
>
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
@end
OF_APPLICATION_DELEGATE(Test)
@implementation Test
- (void)applicationDidFinishLaunching
{
OFString *username =
[[OFApplication environment] objectForKey: @"USER"];
PGResult *result;
connection = [[PGConnection alloc] init];
[connection setParameters:
[OFDictionary dictionaryWithKeysAndObjects: @"user", username,
@"dbname", username,
nil]];
[connection connect];
[connection executeCommand: @"DROP TABLE IF EXISTS test"];
[connection executeCommand: @"CREATE TABLE test ("
@" id integer,"
@" name varchar(255),"
@" content text,"
|