tests: Get username from environment
FossilOrigin-Name: 4c1432632b30cbe6e876af1b803dfbe826166cd9d5bfd4d15043c67bcd9a59de
This commit is contained in:
parent
35212e3305
commit
2600168d95
1 changed files with 5 additions and 2 deletions
|
@ -14,12 +14,15 @@ OF_APPLICATION_DELEGATE(Test)
|
||||||
@implementation Test
|
@implementation Test
|
||||||
- (void)applicationDidFinishLaunching
|
- (void)applicationDidFinishLaunching
|
||||||
{
|
{
|
||||||
|
OFString *username =
|
||||||
|
[[OFApplication environment] objectForKey: @"USER"];
|
||||||
PGResult *result;
|
PGResult *result;
|
||||||
|
|
||||||
connection = [[PGConnection alloc] init];
|
connection = [[PGConnection alloc] init];
|
||||||
[connection setParameters:
|
[connection setParameters:
|
||||||
[OFDictionary dictionaryWithKeysAndObjects: @"user", @"js",
|
[OFDictionary dictionaryWithKeysAndObjects: @"user", username,
|
||||||
@"dbname", @"js", nil]];
|
@"dbname", username,
|
||||||
|
nil]];
|
||||||
[connection connect];
|
[connection connect];
|
||||||
|
|
||||||
[connection executeCommand: @"DROP TABLE IF EXISTS test"];
|
[connection executeCommand: @"DROP TABLE IF EXISTS test"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue