ObjPgSQL  Diff

Differences From Artifact [be5bedb02c]:

To Artifact [4eb664efe8]:


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

#import <ObjFW/ObjFW.h>

#import "PGConnection.h"
#import "PGConnectionFailedException.h"

@interface Test: OFObject <OFApplicationDelegate>
{
	PGConnection *_connection;
}
@end

OF_APPLICATION_DELEGATE(Test)

@implementation Test
- (void)applicationDidFinishLaunching: (OFNotification *)notification
{
	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"];







|
<



|










|

|







14
15
16
17
18
19
20
21

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

#import <ObjFW/ObjFW.h>

#import "ObjPgSQL.h"


@interface Test: OFObject <OFApplicationDelegate>
{
	PGSQLConnection *_connection;
}
@end

OF_APPLICATION_DELEGATE(Test)

@implementation Test
- (void)applicationDidFinishLaunching: (OFNotification *)notification
{
	OFString *username =
	    [[OFApplication environment] objectForKey: @"USER"];
	PGSQLResult *result;

	_connection = [[PGSQLConnection alloc] init];
	[_connection setParameters:
	    [OFDictionary dictionaryWithKeysAndObjects: @"user", username,
							@"dbname", username,
							nil]];
	[_connection connect];

	[_connection executeCommand: @"DROP TABLE IF EXISTS test"];