* EOAdaptors/Postgres95/{*,*/*}: Rename from Postgres95 to Postgres.

* Tools/eoutil.m: Ditto.
        * DBModeler/SQLGenerator.m: Ditto.




git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@23521 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2006-09-15 12:05:56 +00:00
parent dd9ac05f71
commit c54164c770
23 changed files with 254 additions and 248 deletions

View file

@ -1,3 +1,9 @@
2006-09-15 Matt Rice <ratmice@yahoo.com>
* EOAdaptors/Postgres95/{*,*/*}: Rename from Postgres95 to Postgres.
* Tools/eoutil.m: Ditto.
* DBModeler/SQLGenerator.m: Ditto.
2006-09-14 Matt Rice <ratmice@yahoo.com>
* GNUmakefile.in: Remove reference to config.make

View file

@ -182,7 +182,7 @@ static NSString *_otherScript;
channel = [context createAdaptorChannel];
if (_adminScript && [_adminScript length]
&& [[connDict objectForKey:@"adaptorName"] isEqual:@"Postgres95EOAdaptor"])
&& [[connDict objectForKey:@"adaptorName"] isEqual:@"PostgresEOAdaptor"])
{
NSMutableDictionary *tmp = RETAIN([NSMutableDictionary dictionaryWithDictionary:connDict]);
[tmp setObject:@"template1" forKey:@"databaseName"];

View file

@ -30,56 +30,56 @@ include $(GNUSTEP_MAKEFILES)/common.make
include ../../Version
POSTGRES95_DATABASE=@POSTGRES_DATABASE@
POSTGRES_DATABASE=@POSTGRES_DATABASE@
# The framework to be compiled
FRAMEWORK_NAME=Postgres95EOAdaptor
FRAMEWORK_NAME=PostgresEOAdaptor
SUBPROJECTS = LoginPanel
# The framework principal class
Postgres95EOAdaptor_PRINCIPAL_CLASS = Postgres95Adaptor
PostgresEOAdaptor_PRINCIPAL_CLASS = PostgresAdaptor
# The framework Objective-C source files to be compiled
Postgres95EOAdaptor_OBJC_FILES = \
Postgres95Adaptor.m \
Postgres95Context.m \
Postgres95Channel.m \
Postgres95SQLExpression.m \
Postgres95Values.m \
Postgres95Private.m
PostgresEOAdaptor_OBJC_FILES = \
PostgresAdaptor.m \
PostgresContext.m \
PostgresChannel.m \
PostgresSQLExpression.m \
PostgresValues.m \
PostgresPrivate.m
Postgres95EOAdaptor_HEADER_FILES = \
Postgres95Adaptor.h \
Postgres95Context.h \
Postgres95Channel.h \
Postgres95SQLExpression.h \
Postgres95Values.h
PostgresEOAdaptor_HEADER_FILES = \
PostgresAdaptor.h \
PostgresContext.h \
PostgresChannel.h \
PostgresSQLExpression.h \
PostgresValues.h
Postgres95EOAdaptor_AUTOGSDOC_HEADERS = $(Postgres95EOAdaptor_HEADER_FILES)
Postgres95EOAdaptor_AUTOGSDOC_SOURCE = $(Postgres95EOAdaptor_OBJC_FILES)
DOCUMENT_NAME = Postgres95EOAdaptor
Postgres95EOAdaptor_AGSDOC_FILES = Postgres95EOAdaptor.gsdoc $(Postgres95EOAdaptor_AUTOGSDOC_HEADERS)
#$(Postgres95EOAdaptor_AUTOGSDOC_SOURCE)
Postgres95EOAdaptor_AGSDOC_FLAGS = \
PostgresEOAdaptor_AUTOGSDOC_HEADERS = $(PostgresEOAdaptor_HEADER_FILES)
PostgresEOAdaptor_AUTOGSDOC_SOURCE = $(PostgresEOAdaptor_OBJC_FILES)
DOCUMENT_NAME = PostgresEOAdaptor
PostgresEOAdaptor_AGSDOC_FILES = PostgresEOAdaptor.gsdoc $(PostgresEOAdaptor_AUTOGSDOC_HEADERS)
#$(PostgresEOAdaptor_AUTOGSDOC_SOURCE)
PostgresEOAdaptor_AGSDOC_FLAGS = \
-Declared Foundation \
-Standards YES \
-SystemProjects System \
-Project Postgres95EOAdaptor \
-Project PostgresEOAdaptor \
-WordMap '{\
FOUNDATION_EXPORT=extern;FOUNDATION_STATIC_INLINE="";\
GS_GEOM_SCOPE=extern;GS_GEOM_ATTR="";\
GS_EXPORT=extern;GS_DECLARE="";\
GS_RANGE_SCOPE=extern;GS_RANGE_ATTR="";\
GS_ZONE_SCOPE=extern;GS_ZONE_ATTR="";\
}' -Up Postgres95EOAdaptor
}' -Up PostgresEOAdaptor
-include Makefile.preamble
-include GNUmakefile.local
ifeq ($(POSTGRES95_DATABASE),yes)
ifeq ($(POSTGRES_DATABASE),yes)
include $(GNUSTEP_MAKEFILES)/framework.make
include $(GNUSTEP_MAKEFILES)/aggregate.make
else

View file

@ -1,5 +1,5 @@
{
EOAdaptorClassName = Postgres95Adaptor;
NSPrincipalClass = Postgres95Adaptor;
NSExecutable = Postgres95;
EOAdaptorClassName = PostgresAdaptor;
NSPrincipalClass = PostgresAdaptor;
NSExecutable = Postgres;
}

View file

@ -36,8 +36,8 @@ endif
endif
LoginPanel_RESOURCE_FILES = postgreslogo.tif
LoginPanel_OBJC_FILES = Postgres95LoginPanel.m
LoginPanel_PRINCIPAL_CLASS = Postgres95LoginPanel
LoginPanel_OBJC_FILES = PostgresLoginPanel.m
LoginPanel_PRINCIPAL_CLASS = PostgresLoginPanel
LoginPanel_INCLUDE_DIRS = -I.. -I../../..
LoginPanel_LIB_DIRS = \
@ -49,7 +49,7 @@ ifneq ($(FOUNDATION_LIB),gnu)
LoginPanel_OBJC_LIBS += -lgnustep-baseadd
endif
LoginPanel_COPY_INTO_DIR = ../Postgres95EOAdaptor.framework/Resources
LoginPanel_COPY_INTO_DIR = ../PostgresEOAdaptor.framework/Resources
include ../config.mak

View file

@ -40,7 +40,7 @@ before-all::
@echo Skipping login panel compilation. GNUstep gui not installed.
endif
endif
before-all:: Postgres95EOAdaptor
before-all:: PostgresEOAdaptor
# Things to do after compiling
# after-all::
@ -67,7 +67,7 @@ before-all:: Postgres95EOAdaptor
# Things to do after cleaning
after-clean::
rm -f Postgres95EOAdaptor
rm -f PostgresEOAdaptor
# Things to do before distcleaning
# before-distclean::
@ -82,5 +82,5 @@ after-distclean::
# Things to do after checking
# after-check::
Postgres95EOAdaptor:
${LN_S} ../Postgres95EOAdaptor.framework/Headers Postgres95EOAdaptor
PostgresEOAdaptor:
${LN_S} ../PostgresEOAdaptor.framework/Headers PostgresEOAdaptor

View file

@ -1,5 +1,5 @@
/** -*-ObjC-*-
Postgres95LoginPanel.h
PostgresLoginPanel.h
Copyright (C) 2004,2005 Free Software Foundation, Inc.
@ -25,10 +25,10 @@
*/
#include <EOAccess/EOAccess.h>
#include "Postgres95Channel.h"
#include "Postgres95SQLExpression.h"
#include "PostgresChannel.h"
#include "PostgresSQLExpression.h"
@interface Postgres95LoginPanel : EOLoginPanel
@interface PostgresLoginPanel : EOLoginPanel
{
/* gui stuff */
NSWindow *_win;

View file

@ -1,5 +1,5 @@
/** -*-ObjC-*-
Postgres95LoginPanel.m
PostgresLoginPanel.m
Copyright (C) 2004,2005 Free Software Foundation, Inc.
@ -33,7 +33,7 @@
#include <GNUstepBase/GSCategories.h>
#endif
#include "Postgres95LoginPanel.h"
#include "PostgresLoginPanel.h"
static BOOL insideModalLoop;
@ -81,7 +81,7 @@ vfmaxf (int n, float aFloat, ...)
@implementation Postgres95LoginPanel : EOLoginPanel
@implementation PostgresLoginPanel : EOLoginPanel
- (void) dealloc
{
@ -407,7 +407,7 @@ vfmaxf (int n, float aFloat, ...)
aMod = [EOModel new];
[aMod setName: @"AvailableDatabases"];
[aMod setAdaptorName: @"Postgres95"];
[aMod setAdaptorName: @"Postgres"];
/*
we need a connection to a known database template1 should exist
*/
@ -441,7 +441,7 @@ vfmaxf (int n, float aFloat, ...)
if (!exceptionOccured)
{
[channel openChannel];
databaseNames = [(Postgres95Channel*)channel describeDatabaseNames];
databaseNames = [(PostgresChannel*)channel describeDatabaseNames];
[channel closeChannel];
RELEASE(aMod);
}
@ -489,7 +489,7 @@ vfmaxf (int n, float aFloat, ...)
{
if (adminFlag)
{
BOOL isAdmin = [(Postgres95Channel*)adaptorChannel
BOOL isAdmin = [(PostgresChannel*)adaptorChannel
userNameIsAdministrative: [userNameField stringValue]];
if (!isAdmin)
{
@ -602,7 +602,7 @@ vfmaxf (int n, float aFloat, ...)
[userNameField stringValue],@"userName",
[passwdField stringValue], @"password",
nil];
adaptor = [EOAdaptor adaptorWithName:@"Postgres95"];
adaptor = [EOAdaptor adaptorWithName:@"Postgres"];
[adaptor setConnectionDictionary:connDict];
// hmm if the user isn't an admin the error is kinda ugly..

View file

@ -1,12 +1,12 @@
/*
Postgres95Adaptor.h
PostgresAdaptor.h
Copyright (C) 2000,2002,2003,2005 Free Software Foundation, Inc.
Author: Mirko Viviani <mirko.viviani@gmail.com
Date: February 2000
based on the Postgres95 adaptor written by
based on the Postgres adaptor written by
Mircea Oancea <mircea@jupiter.elcom.pub.ro>
This file is part of the GNUstep Database Library.
@ -27,13 +27,13 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __Postgres95Adaptor_h__
#define __Postgres95Adaptor_h__
#ifndef __PostgresAdaptor_h__
#define __PostgresAdaptor_h__
#include <EOAccess/EOAdaptor.h>
/* Include Postgres 95 Headers */
/* Include Postgres Headers */
#undef Assert
#include <stdio.h>
@ -53,9 +53,9 @@
(default getenv(PGDATABASE))
databaseVersion - the Version of the database
(default parsed from #define PG_VERSION)
options - additional options sent to the POSTGRES95 backend
options - additional options sent to the POSTGRES backend
(default getenv(PGOPTIONS))
port - port to communicate with POSTGRES95 backend
port - port to communicate with POSTGRES backend
(default getenv(PGPORT))
debugTTY - filename (file/device) used for debugging output
(default getenv(PGTTY))
@ -70,7 +70,7 @@
extern int
postgresClientVersion();
@interface Postgres95Adaptor : EOAdaptor
@interface PostgresAdaptor : EOAdaptor
{
NSMutableArray *_pgConnPool;
int _pgConnPoolLimit;
@ -103,8 +103,8 @@ postgresClientVersion();
- (void)setPrimaryKeySequenceNameFormat: (NSString*)format;
- (NSString*)primaryKeySequenceNameFormat;
extern NSString *Postgres95Exception;
extern NSString *PostgresException;
@end
#endif /* __Postgres95Adaptor_h__ */
#endif /* __PostgresAdaptor_h__ */

View file

@ -1,12 +1,12 @@
/**
Postgres95Adaptor.m <title>Postgres95Adaptor</title>
PostgresAdaptor.m <title>PostgresAdaptor</title>
Copyright (C) 2000,2002,2003,2004,2005 Free Software Foundation, Inc.
Author: Mirko Viviani <mirko.viviani@gmail.com>
Date: February 2000
based on the Postgres95 adaptor written by
based on the Postgres adaptor written by
Mircea Oancea <mircea@jupiter.elcom.pub.ro>
Author: Manuel Guesdon <mguesdon@orange-concept.com>
@ -70,15 +70,15 @@ RCS_ID("$Id$")
#include <EOAccess/EOEntity.h>
#include <EOAccess/EOModel.h>
#include <Postgres95EOAdaptor/Postgres95Adaptor.h>
#include <Postgres95EOAdaptor/Postgres95Context.h>
#include <Postgres95EOAdaptor/Postgres95Channel.h>
#include <Postgres95EOAdaptor/Postgres95SQLExpression.h>
#include <Postgres95EOAdaptor/Postgres95Values.h>
#include <PostgresEOAdaptor/PostgresAdaptor.h>
#include <PostgresEOAdaptor/PostgresContext.h>
#include <PostgresEOAdaptor/PostgresChannel.h>
#include <PostgresEOAdaptor/PostgresSQLExpression.h>
#include <PostgresEOAdaptor/PostgresValues.h>
#include "Postgres95Private.h"
#include "PostgresPrivate.h"
NSString *Postgres95Exception = @"Postgres95Exception";
NSString *PostgresException = @"PostgresException";
static int pgConnTotalAllocated = 0;
static int pgConnCurrentAllocated = 0;
@ -95,11 +95,11 @@ postgresClientVersion()
}
@implementation Postgres95Adaptor
@implementation PostgresAdaptor
- init
{
return [self initWithName: @"Postgres95"];
return [self initWithName: @"Postgres"];
}
- initWithName: (NSString *)name
@ -288,7 +288,7 @@ static NSString *typeNames[][2] = {
- (EOAdaptorContext *)createAdaptorContext
{
//OK
return [Postgres95Context adaptorContextWithAdaptor: self];
return [PostgresContext adaptorContextWithAdaptor: self];
}
- (Class)defaultExpressionClass
@ -297,7 +297,7 @@ static NSString *typeNames[][2] = {
EOFLOGObjectFnStart();
expressionClass = [Postgres95SQLExpression class];
expressionClass = [PostgresSQLExpression class];
EOFLOGObjectFnStop();
@ -353,7 +353,7 @@ static NSString *typeNames[][2] = {
-(NSString *)formatValue:(id)value
forAttribute:(EOAttribute*)attribute
{
return [value stringValueForPostgres95Type:[attribute externalType]
return [value stringValueForPostgresType:[attribute externalType]
attribute:attribute];
}
*/
@ -425,7 +425,7 @@ static NSString *typeNames[][2] = {
NSDebugMLog(@"%s %s %s %s %s", pg_host, pg_port, pg_database, pg_user, pg_pwd);
// Try to connect to the Postgres95 server
// Try to connect to the Postgres server
if (pg_user)
pgConn = PQsetdbLogin(pg_host, pg_port, pg_options, pg_tty,
pg_database,pg_user,pg_pwd);
@ -542,7 +542,7 @@ static NSString *typeNames[][2] = {
return _primaryKeySequenceNameFormat;
}
@end /* Postgres95Adaptor */
@end /* PostgresAdaptor */
/*
//TODO

View file

@ -1,12 +1,12 @@
/* -*-objc-*-
Postgres95Channel.h
PostgresChannel.h
Copyright (C) 2000,2002,2003,2004,2005 Free Software Foundation, Inc.
Author: Mirko Viviani <mirko.viviani@gmail.com>
Date: February 2000
based on the Postgres95 adaptor written by
based on the Postgres adaptor written by
Mircea Oancea <mircea@jupiter.elcom.pub.ro>
This file is part of the GNUstep Database Library.
@ -27,11 +27,11 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __Postgres95Channel_h__
#define __Postgres95Channel_h__
#ifndef __PostgresChannel_h__
#define __PostgresChannel_h__
#include <EOAccess/EOAdaptorChannel.h>
#include <Postgres95EOAdaptor/Postgres95Context.h>
#include <PostgresEOAdaptor/PostgresContext.h>
@class NSString;
@ -39,9 +39,9 @@
@class NSMutableArray;
@class EOAttribute;
@interface Postgres95Channel : EOAdaptorChannel
@interface PostgresChannel : EOAdaptorChannel
{
Postgres95Context *_adaptorContext;
PostgresContext *_adaptorContext;
PGconn *_pgConn;
PGresult *_pgResult;
NSArray *_attributes;
@ -55,9 +55,9 @@
int _pgVersion;
struct {
unsigned int postgres95InsertedRowOid:1;
unsigned int postgres95Notification:1;
} _postgres95DelegateRespondsTo;
unsigned int postgresInsertedRowOid:1;
unsigned int postgresNotification:1;
} _postgresDelegateRespondsTo;
}
- (PGconn*)pgConn;
@ -83,13 +83,13 @@
withAttributes: (NSArray*)attributes;
@end
@interface NSObject (Postgres95ChannelDelegate)
@interface NSObject (PostgresChannelDelegate)
- (void)postgres95Channel: (Postgres95Channel*)channel
- (void)postgresChannel: (PostgresChannel*)channel
insertedRowWithOid: (Oid)oid;
- (void)postgres95Channel: (Postgres95Channel*)channel
- (void)postgresChannel: (PostgresChannel*)channel
receivedNotification: (NSString*)notification;
@end
#endif /* __Postgres95Channel_h__ */
#endif /* __PostgresChannel_h__ */

View file

@ -1,12 +1,12 @@
/**
Postgres95Channel.m <title>Postgres95Channel</title>
PostgresChannel.m <title>PostgresChannel</title>
Copyright (C) 2000-2002,2003,2004,2005 Free Software Foundation, Inc.
Author: Mirko Viviani <mirko.viviani@gmail.com>
Date: February 2000
based on the Postgres95 adaptor written by
based on the Postgres adaptor written by
Mircea Oancea <mircea@jupiter.elcom.pub.ro>
Author: Manuel Guesdon <mguesdon@orange-concept.com>
@ -73,17 +73,17 @@ RCS_ID("$Id$")
#include <EOAccess/EOModel.h>
#include <EOAccess/EOSQLExpression.h>
#include <Postgres95EOAdaptor/Postgres95Channel.h>
#include <Postgres95EOAdaptor/Postgres95Context.h>
#include <Postgres95EOAdaptor/Postgres95Values.h>
#include <PostgresEOAdaptor/PostgresChannel.h>
#include <PostgresEOAdaptor/PostgresContext.h>
#include <PostgresEOAdaptor/PostgresValues.h>
#include "Postgres95Private.h"
#include "PostgresPrivate.h"
static void __dummy_function_used_for_linking(void)
{
extern void __postgres95_values_linking_function(void);
extern void __postgres_values_linking_function(void);
__postgres95_values_linking_function();
__postgres_values_linking_function();
__dummy_function_used_for_linking();
}
@ -179,7 +179,7 @@ pgResultDictionary(PGresult *pgResult)
nil];
}
@implementation Postgres95Channel
@implementation PostgresChannel
+ (void) initialize
{
@ -189,7 +189,7 @@ pgResultDictionary(PGresult *pgResult)
Class aClass=Nil;
PSQLA_PrivInit();
aClass=[Postgres95Values class]; // Force Initialize;
aClass=[PostgresValues class]; // Force Initialize;
};
};
@ -202,7 +202,7 @@ pgResultDictionary(PGresult *pgResult)
if (_pgResult == NULL || PQresultStatus(_pgResult) != PGRES_COMMAND_OK)
{
_pgResult = NULL;
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot set date style to ISO."];
}
@ -257,7 +257,7 @@ pgResultDictionary(PGresult *pgResult)
//OK
NSAssert(!_pgConn, @"Channel already opened");
_pgConn = [(Postgres95Adaptor *)[[self adaptorContext] adaptor] newPGconn];
_pgConn = [(PostgresAdaptor *)[[self adaptorContext] adaptor] newPGconn];
if (_pgConn)
{
@ -272,7 +272,7 @@ pgResultDictionary(PGresult *pgResult)
NSAssert(_pgConn, @"Channel not opened");
[self _cancelResults];
[(Postgres95Adaptor *)[[self adaptorContext] adaptor] releasePGconn: _pgConn
[(PostgresAdaptor *)[[self adaptorContext] adaptor] releasePGconn: _pgConn
force: NO];
_pgConn = NULL;
}
@ -434,7 +434,7 @@ zone:zone
NSDebugMLog(@"_attributes=%@", _attributes);
NSDebugMLog(@"result=%@", [self lowLevelResultFieldNames:
_pgResult]);
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"attempt to read %d attributes "
@"when the result set has only %d columns",
count, PQnfields(_pgResult)];
@ -472,7 +472,7 @@ zone:zone
string = [self _readBinaryDataRow: (Oid)atol(string)
length:&length zone: zone];
//For efficiency reasons, the returned value is NOT autoreleased !
values[i] = PSQLA_Postgres95Values_newValueForBytesLengthAttribute(string,length,attr);
values[i] = PSQLA_PostgresValues_newValueForBytesLengthAttribute(string,length,attr);
}
else
{
@ -490,7 +490,7 @@ zone:zone
else
{
//For efficiency reasons, the returned value is NOT autoreleased !
values[i] = PSQLA_Postgres95Values_newValueForBytesLengthAttribute(string,length,attr);
values[i] = PSQLA_PostgresValues_newValueForBytesLengthAttribute(string,length,attr);
}
}
@ -575,7 +575,7 @@ zone:zone
[_sqlExpression statement], errorString);
NSDebugMLLog(@"SQL expression '%@' caused %@",
[_sqlExpression statement], errorString);
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"unexpected result returned by PQresultStatus(): %@",errorString];
EOFLOGObjectFnStop();
@ -590,7 +590,7 @@ zone:zone
[_sqlExpression statement], status, errorString);
NSDebugMLLog(@"SQL expression '%@' returned status %d: %@",
[_sqlExpression statement], status, errorString);
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"unexpected result returned by PQresultStatus(): status %d: %@",
status,errorString];
@ -608,8 +608,8 @@ zone:zone
if (notify)
{
if (_postgres95DelegateRespondsTo.postgres95Notification)
[_delegate postgres95Channel: self
if (_postgresDelegateRespondsTo.postgresNotification)
[_delegate postgresChannel: self
receivedNotification:
[NSString stringWithCString: notify->relname]];
@ -618,11 +618,11 @@ zone:zone
insoid = PQoidStatus(_pgResult);
if (*insoid && _postgres95DelegateRespondsTo.postgres95InsertedRowOid)
if (*insoid && _postgresDelegateRespondsTo.postgresInsertedRowOid)
{
Oid oid = atol(insoid);
[_delegate postgres95Channel: self insertedRowWithOid: oid];
[_delegate postgresChannel: self insertedRowWithOid: oid];
}
}
@ -640,7 +640,7 @@ zone:zone
message = [NSString stringWithFormat:
@"Command status %@. Returned %d rows with %d columns ",
message, PQntuples(_pgResult), PQnfields(_pgResult)];
NSLog (@"Postgres95Adaptor: %@", message);
NSLog (@"PostgresAdaptor: %@", message);
}
NSDebugMLLog(@"gsdb", @"ret=%s", (ret ? "YES" : "NO"));
@ -665,11 +665,11 @@ zone:zone
// NSDebugMLLog(@"gsdb",@"EE _origAttributes=%@",_origAttributes);
// NSDebugMLLog(@"gsdb",@"EE _attributes=%@",_attributes);
NSDebugMLLog(@"gsdb", @"Postgres95Adaptor: execute command:\n%@\n",
NSDebugMLLog(@"gsdb", @"PostgresAdaptor: execute command:\n%@\n",
[expression statement]);
if ([self isDebugEnabled] == YES)
NSLog(@"Postgres95Adaptor: execute command:\n%@\n",
NSLog(@"PostgresAdaptor: execute command:\n%@\n",
[expression statement]);
//call PostgreSQLChannel numberOfAffectedRows
/* Send the expression to the SQL server */
@ -682,7 +682,7 @@ zone:zone
if ([self isDebugEnabled])
{
adaptorContext = [self adaptorContext];
[(Postgres95Adaptor *)[adaptorContext adaptor]
[(PostgresAdaptor *)[adaptorContext adaptor]
privateReportError: _pgConn];
}
}
@ -704,12 +704,12 @@ zone:zone
- (void)evaluateExpression: (EOSQLExpression *)expression // OK quasi
{
Postgres95Context *adaptorContext = nil;
PostgresContext *adaptorContext = nil;
EOFLOGObjectFnStart();
//_evaluationIsDirectCalled=1
adaptorContext = (Postgres95Context *)[self adaptorContext];
adaptorContext = (PostgresContext *)[self adaptorContext];
//call expression statement
//call adaptorContext adaptor
//call adaptor databaseEncoding
@ -729,7 +729,7 @@ zone:zone
}
if ([self isOpen] == NO)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot execute SQL expression. Channel is not opened."];
[self _cancelResults];
@ -764,7 +764,7 @@ zone:zone
NSMutableDictionary *nrow = nil;
NSEnumerator *enumerator = nil;
NSString *attrName = nil;
Postgres95Context *adaptorContext = nil;
PostgresContext *adaptorContext = nil;
IMP attrEnumNO=NULL; // nextObject
IMP rowOFK=NULL; // objectForKey:
IMP nrowSOFK=NULL; // setObject:forKey:
@ -799,7 +799,7 @@ zone:zone
nrow = AUTORELEASE([row mutableCopy]);
adaptorContext = (Postgres95Context *)[self adaptorContext];
adaptorContext = (PostgresContext *)[self adaptorContext];
[self _cancelResults]; //No done by WO
@ -877,7 +877,7 @@ each key
{
EOSQLExpression *sqlexpr = nil;
unsigned long rows = 0;
Postgres95Context *adaptorContext;
PostgresContext *adaptorContext;
EOFLOGObjectFnStart();
@ -903,7 +903,7 @@ each key
NSStringFromClass([self class]),
self];
adaptorContext = (Postgres95Context *)[self adaptorContext];
adaptorContext = (PostgresContext *)[self adaptorContext];
[self _cancelResults];
[_adaptorContext autoBeginTransaction: NO];
@ -1044,7 +1044,7 @@ each key
NSString *attrName = nil;
NSString *externalType = nil;
EOAttribute *attr = nil;
Postgres95Context *adaptorContext = nil;
PostgresContext *adaptorContext = nil;
unsigned long rows = 0;
IMP valuesOFK=NULL; // objectForKey:
@ -1098,7 +1098,7 @@ each key
}
[self _cancelResults]; //Not in WO
adaptorContext = (Postgres95Context *)[self adaptorContext];
adaptorContext = (PostgresContext *)[self adaptorContext];
[adaptorContext autoBeginTransaction: YES];
if ([invAttributes count])
@ -1194,7 +1194,7 @@ each key
fd = lo_open(_pgConn, oid, INV_READ|INV_WRITE);
if (fd < 0)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot open large object Oid = %ld", oid];
lo_lseek(_pgConn, fd, 0, SEEK_END);
@ -1202,7 +1202,7 @@ each key
lo_lseek(_pgConn, fd, 0, SEEK_SET);
if (len < 0)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"error while getting size of large object Oid = %ld", oid];
bytes = NSZoneMalloc(zone, len);
@ -1211,7 +1211,7 @@ each key
if (len != wrt)
{
NSZoneFree(zone, bytes);
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"error while reading large object Oid = %ld", oid];
}
lo_close(_pgConn, fd);
@ -1237,18 +1237,18 @@ each key
oid = lo_creat(_pgConn, INV_READ|INV_WRITE);
if (oid == 0)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot create large object"];
fd = lo_open(_pgConn, oid, INV_READ|INV_WRITE);
if (fd < 0)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot open large object Oid = %ld", oid];
wrt = lo_write(_pgConn, fd, (char *)bytes, len);
if (len != wrt)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"error while writing large object Oid = %ld", oid];
lo_close(_pgConn, fd);
@ -1274,18 +1274,18 @@ each key
oid = lo_creat(_pgConn, INV_READ|INV_WRITE);
if (oid == 0)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot create large object"];
fd = lo_open(_pgConn, oid, INV_READ|INV_WRITE);
if (fd < 0)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot open large object Oid = %ld", oid];
wrt = lo_write(_pgConn, fd, (char*)bytes, len);
if (len != wrt)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"error while writing large object Oid = %ld", oid];
lo_close(_pgConn, fd);
@ -1305,7 +1305,7 @@ each key
if (_pgResult == NULL || PQresultStatus(_pgResult) != PGRES_TUPLES_OK)
{
_pgResult = NULL;
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot read type name informations from database. "
@"bad response from server"];
}
@ -1313,7 +1313,7 @@ each key
if (PQnfields(_pgResult) != 2)
{
_pgResult = NULL;
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot read type name informations from database. "
@"results should have two columns"];
}
@ -1344,7 +1344,7 @@ each key
if (_pgResult == NULL || PQresultStatus(_pgResult) != PGRES_TUPLES_OK)
{
_pgResult = NULL;
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot read type name informations from database. "
@"bad response from server"];
}
@ -1364,7 +1364,7 @@ each key
- (void)setAttributesToFetch: (NSArray *)attributes
{
//call adaptorContext
NSDebugMLLog(@"gsdb", @"Postgres95Channel: setAttributesToFetch %p:%@",
NSDebugMLLog(@"gsdb", @"PostgresChannel: setAttributesToFetch %p:%@",
attributes, attributes);
ASSIGN(_attributes, attributes);
@ -1440,7 +1440,7 @@ each key
&oidToTypeNameOFK,externalTypeNumber);
if (!externalType)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot find type for Oid = %d",
PQftype(_pgResult, i)];
@ -1529,7 +1529,7 @@ each key
|| PQresultStatus(_pgResult) != PGRES_TUPLES_OK)
{
_pgResult = NULL;
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot read list of tables from database. "
@"bad response from server"];
}
@ -1579,13 +1579,13 @@ each key
stmt = [NSS_SWF: @"SELECT oid FROM pg_class "
@"WHERE relname = '%@' AND relkind = 'r'",tableName];
EOAdaptorDebugLog(@"Postgres95Adaptor: execute command:\n%@", stmt);
EOAdaptorDebugLog(@"PostgresAdaptor: execute command:\n%@", stmt);
_pgResult = PQexec(_pgConn, [stmt cString]);
if (_pgResult == NULL || PQresultStatus(_pgResult) != PGRES_TUPLES_OK)
{
_pgResult = NULL;
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot read type name information from database."
@"bad response from server"];
}
@ -1593,7 +1593,7 @@ each key
if (PQntuples(_pgResult) != 1)
{
_pgResult = NULL;
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"Table %@ doesn't exist", tableName];
}
@ -1605,7 +1605,7 @@ each key
@"WHERE attnum > 0 AND attrelid=%@"
@"AND attisdropped IS FALSE", tableOid];
EOAdaptorDebugLog(@"Postgres95Adaptor: execute command:\n%@", stmt);
EOAdaptorDebugLog(@"PostgresAdaptor: execute command:\n%@", stmt);
PQclear(_pgResult);
_pgResult = PQexec(_pgConn, [stmt cString]);
@ -1682,7 +1682,7 @@ each key
@"WHERE indrelid='%@' AND indisprimary = 't'",
tableOid];
EOAdaptorDebugLog(@"Postgres95Adaptor: execute command:\n%@", stmt);
EOAdaptorDebugLog(@"PostgresAdaptor: execute command:\n%@", stmt);
_pgResult = PQexec(_pgConn,[stmt cString]);
if (PQntuples(_pgResult))
{
@ -1696,7 +1696,7 @@ each key
tableOid, pkAttNum];
PQclear(_pgResult);
EOAdaptorDebugLog(@"Postgres95Adaptor: execute command:\n%@", stmt);
EOAdaptorDebugLog(@"PostgresAdaptor: execute command:\n%@", stmt);
_pgResult = PQexec(_pgConn,[stmt cString]);
if (PQntuples(_pgResult))
@ -1747,7 +1747,7 @@ each key
PQclear(_pgResult);
EOAdaptorDebugLog(@"Postgres95Adaptor: execute command:\n%@", stmt);
EOAdaptorDebugLog(@"PostgresAdaptor: execute command:\n%@", stmt);
_pgResult = PQexec(_pgConn, [stmt cString]);
for (i = 0, n = PQntuples(_pgResult); i < n; i++)
@ -1951,12 +1951,12 @@ each key
{
[super setDelegate: delegate];
_postgres95DelegateRespondsTo.postgres95InsertedRowOid =
_postgresDelegateRespondsTo.postgresInsertedRowOid =
[delegate respondsToSelector:
@selector(postgres95Channel:insertedRowWithOid:)];
_postgres95DelegateRespondsTo.postgres95Notification =
@selector(postgresChannel:insertedRowWithOid:)];
_postgresDelegateRespondsTo.postgresNotification =
[delegate respondsToSelector:
@selector(postgres95Channel:receivedNotification:)];
@selector(postgresChannel:receivedNotification:)];
}
- (NSDictionary *)primaryKeyForNewRowWithEntity:(EOEntity *)entity
@ -1982,7 +1982,7 @@ each key
EOFLOGObjectFnStart();
primaryKeySequenceNameFormat
= [(Postgres95Context*)[self adaptorContext] primaryKeySequenceNameFormat];
= [(PostgresContext*)[self adaptorContext] primaryKeySequenceNameFormat];
NSAssert(primaryKeySequenceNameFormat, @"No primary sequence name format");
expr = AUTORELEASE([[[_adaptorContext adaptor] expressionClass] new]);
@ -2012,7 +2012,7 @@ each key
length = PQgetlength(_pgResult, _currentResultRow, 0);
attr = [_pkAttributeArray objectAtIndex: 0];
pkValue = AUTORELEASE(PSQLA_Postgres95Values_newValueForBytesLengthAttribute(string,length,attr));
pkValue = AUTORELEASE(PSQLA_PostgresValues_newValueForBytesLengthAttribute(string,length,attr));
NSAssert(pkValue, @"no pk value");
key = [[entity primaryKeyAttributeNames] objectAtIndex: 0];
@ -2032,11 +2032,11 @@ each key
- (void)cleanupFetch
{
Postgres95Context *adaptorContext;
PostgresContext *adaptorContext;
EOFLOGObjectFnStart();
adaptorContext = (Postgres95Context *)[self adaptorContext];
adaptorContext = (PostgresContext *)[self adaptorContext];
NSDebugMLog(@"[self isFetchInProgress]=%s",
([self isFetchInProgress] ? "YES" : "NO"));
@ -2055,4 +2055,4 @@ each key
EOFLOGObjectFnStop();
}
@end /* Postgres95Channel */
@end /* PostgresChannel */

View file

@ -1,5 +1,5 @@
/**
Postgres95Compatibility.h
PostgresCompatibility.h
Copyright (C) 2004,2005 Free Software Foundation, Inc.

View file

@ -1,12 +1,12 @@
/*
Postgres95Context.h
PostgresContext.h
Copyright (C) 2000,2002,2003,2005 Free Software Foundation, Inc.
Author: Mirko Viviani <mirko.viviani@gmail.com>
Date: February 2000
based on the Postgres95 adaptor written by
based on the Postgres adaptor written by
Mircea Oancea <mircea@jupiter.elcom.pub.ro>
This file is part of the GNUstep Database Library.
@ -27,14 +27,14 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __Postgres95Context_h__
#define __Postgres95Context_h__
#ifndef __PostgresContext_h__
#define __PostgresContext_h__
#include <EOAccess/EOAdaptorContext.h>
#include <Postgres95EOAdaptor/Postgres95Adaptor.h>
#include <PostgresEOAdaptor/PostgresAdaptor.h>
@interface Postgres95Context : EOAdaptorContext
@interface PostgresContext : EOAdaptorContext
{
NSString* _primaryKeySequenceNameFormat;
struct
@ -68,4 +68,4 @@
@end
#endif /* __Postgres95Context_h__ */
#endif /* __PostgresContext_h__ */

View file

@ -1,12 +1,12 @@
/**
Postgres95Context.m <title>Postgres95Context</title>
PostgresContext.m <title>PostgresContext</title>
Copyright (C) 2000-2002,2003,2004,2005 Free Software Foundation, Inc.
Author: Mirko Viviani <mirko.viviani@gmail.com>
Date: February 2000
based on the Postgres95 adaptor written by
based on the Postgres adaptor written by
Mircea Oancea <mircea@jupiter.elcom.pub.ro>
Author: Manuel Guesdon <mguesdon@orange-concept.com>
@ -58,13 +58,13 @@ RCS_ID("$Id$")
#include <EOControl/EODebug.h>
#include <Postgres95EOAdaptor/Postgres95Adaptor.h>
#include <Postgres95EOAdaptor/Postgres95Context.h>
#include <Postgres95EOAdaptor/Postgres95Channel.h>
#include <Postgres95EOAdaptor/Postgres95SQLExpression.h>
#include <PostgresEOAdaptor/PostgresAdaptor.h>
#include <PostgresEOAdaptor/PostgresContext.h>
#include <PostgresEOAdaptor/PostgresChannel.h>
#include <PostgresEOAdaptor/PostgresSQLExpression.h>
@implementation Postgres95Context
@implementation PostgresContext
- (id)initWithAdaptor: (EOAdaptor *)adaptor
{
@ -72,7 +72,7 @@ RCS_ID("$Id$")
{
if (adaptor)
[self setPrimaryKeySequenceNameFormat:
[(Postgres95Adaptor*)adaptor primaryKeySequenceNameFormat]];
[(PostgresAdaptor*)adaptor primaryKeySequenceNameFormat]];
}
return self;
@ -80,7 +80,7 @@ RCS_ID("$Id$")
- (void)beginTransaction
{
Postgres95Channel *channel = nil;
PostgresChannel *channel = nil;
EOFLOGObjectFnStart();
@ -94,7 +94,7 @@ RCS_ID("$Id$")
if (_delegateRespondsTo.shouldBegin)
{
if (![_delegate adaptorContextShouldBegin: self])
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"%@ -- %@ 0x%x: delegate refuses",
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
@ -104,7 +104,7 @@ RCS_ID("$Id$")
channel = [[_channels objectAtIndex: 0] nonretainedObjectValue];
if ([channel isOpen] == NO)
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"cannot execute SQL expression. Channel is not opened."];
_flags.didBegin = YES;
@ -148,7 +148,7 @@ RCS_ID("$Id$")
if (_delegateRespondsTo.shouldCommit)
{
if (![_delegate adaptorContextShouldCommit: self])
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"%@ -- %@ 0x%x: delegate refuses",
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
@ -196,7 +196,7 @@ RCS_ID("$Id$")
if (_delegateRespondsTo.shouldRollback)
{
if (![_delegate adaptorContextShouldRollback: self])
[NSException raise: Postgres95Exception
[NSException raise: PostgresException
format: @"%@ -- %@ 0x%x: delegate refuses",
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
@ -233,7 +233,7 @@ RCS_ID("$Id$")
//OK
EOAdaptorChannel *adaptorChannel;
adaptorChannel = [Postgres95Channel adaptorChannelWithAdaptorContext: self];
adaptorChannel = [PostgresChannel adaptorChannelWithAdaptorContext: self];
return adaptorChannel;
}
@ -320,7 +320,7 @@ RCS_ID("$Id$")
return _primaryKeySequenceNameFormat;
}
@end /* Postgres95Context */
@end /* PostgresContext */
/*
//TODO
autoCommitTransaction

View file

@ -2,7 +2,7 @@
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.7//EN" "http://www.gnustep.org/gsdoc-0_6_7.xml">
<gsdoc base="index">
<head>
<title>GDL2 Postgres95 Adaptor</title>
<title>GDL2 Postgres Adaptor</title>
<author name="Mirko Viviani">
<email address="mirko.viviani@gmail.com"/>
<url url="http://www.gnustep.org/developers/whoiswho.html"/></author>
@ -12,7 +12,7 @@
</head>
<body>
<chapter>
<heading>GDL2 Postgres95 Adaptor</heading>
<heading>GDL2 Postgres Adaptor</heading>
<p>...
</p>
</chapter>

View file

@ -1,5 +1,5 @@
/* -*-objc-*-
Postgres95Private.h
PostgresPrivate.h
Copyright (C) 2005 Free Software Foundation, Inc.
@ -24,8 +24,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __Postgres95Private_h__
#define __Postgres95Private_h__
#ifndef __PostgresPrivate_h__
#define __PostgresPrivate_h__
@class NSNumber;
@class EONull;
@ -38,7 +38,7 @@ extern Class PSQLA_NSCalendarDateClass;
extern Class PSQLA_NSDateClass;
extern Class PSQLA_NSMutableArrayClass;
extern Class PSQLA_EOAttributeClass;
extern Class PSQLA_Postgres95ValuesClass;
extern Class PSQLA_PostgresValuesClass;
// ==== IMPs ====
extern IMP PSQLA_NSNumber_allocWithZoneIMP;
@ -47,7 +47,7 @@ extern IMP PSQLA_NSString_allocWithZoneIMP;
extern IMP PSQLA_NSCalendarDate_allocWithZoneIMP;
extern IMP PSQLA_NSMutableArray_allocWithZoneIMP;
extern IMP PSQLA_EOAttribute_allocWithZoneIMP;
extern IMP PSQLA_Postgres95Values_newValueForBytesLengthAttributeIMP;
extern IMP PSQLA_PostgresValues_newValueForBytesLengthAttributeIMP;
// ==== Constants ====
extern NSNumber *PSQLA_NSNumberBool_Yes;
@ -71,12 +71,12 @@ _isNilOrEONull(id obj)
return (obj == nil || obj == PSQLA_EONull) ? YES : NO;
}
// ---- Postgres95Values newValueForBytes:length:attribute ----
#define PSQLA_Postgres95Values_newValueForBytesLengthAttribute(bytes, \
// ---- PostgresValues newValueForBytes:length:attribute ----
#define PSQLA_PostgresValues_newValueForBytesLengthAttribute(bytes, \
length, \
attribute) \
(*PSQLA_Postgres95Values_newValueForBytesLengthAttributeIMP) \
(PSQLA_Postgres95ValuesClass, \
(*PSQLA_PostgresValues_newValueForBytesLengthAttributeIMP) \
(PSQLA_PostgresValuesClass, \
@selector(newValueForBytes:length:attribute:), \
(bytes), (length), (attribute))
@ -159,5 +159,5 @@ PSQLA_SetObjectForKeyWithImpPtr(id object,IMP* impPtr,id value, id key)
(PSQLA_##CLASS_NAME##Class,@selector(allocWithZone:),NULL)
#endif /* __Postgres95Private_h__ */
#endif /* __PostgresPrivate_h__ */

View file

@ -1,5 +1,5 @@
/**
Postgres95Private.m <title>Postgres95Private: various definitions</title>
PostgresPrivate.m <title>PostgresPrivate: various definitions</title>
Copyright (C) 2005 Free Software Foundation, Inc.
@ -44,7 +44,7 @@ RCS_ID("$Id$")
#include <EOControl/EONull.h>
#include <EOAccess/EOAttribute.h>
#include "Postgres95Values.h"
#include "PostgresValues.h"
// ==== Classes ====
Class PSQLA_NSStringClass=Nil;
@ -54,7 +54,7 @@ Class PSQLA_NSCalendarDateClass=Nil;
Class PSQLA_NSDateClass=Nil;
Class PSQLA_NSMutableArrayClass;
Class PSQLA_EOAttributeClass=Nil;
Class PSQLA_Postgres95ValuesClass=Nil;
Class PSQLA_PostgresValuesClass=Nil;
// ==== IMPs ====
IMP PSQLA_NSNumber_allocWithZoneIMP=NULL;
@ -63,7 +63,7 @@ IMP PSQLA_NSString_allocWithZoneIMP=NULL;
IMP PSQLA_NSCalendarDate_allocWithZoneIMP=NULL;
IMP PSQLA_NSMutableArray_allocWithZoneIMP=NULL;
IMP PSQLA_EOAttribute_allocWithZoneIMP=NULL;
IMP PSQLA_Postgres95Values_newValueForBytesLengthAttributeIMP=NULL;
IMP PSQLA_PostgresValues_newValueForBytesLengthAttributeIMP=NULL;
// ==== Constants ====
NSNumber *PSQLA_NSNumberBool_Yes=nil;
@ -90,7 +90,7 @@ PSQLA_PrivInit(void)
PSQLA_NSCalendarDateClass=[NSCalendarDate class];
PSQLA_NSDateClass=[NSDate class];
PSQLA_EOAttributeClass = [EOAttribute class];
PSQLA_Postgres95ValuesClass = [Postgres95Values class];
PSQLA_PostgresValuesClass = [PostgresValues class];
// ==== IMPs ====
PSQLA_NSNumber_allocWithZoneIMP=
@ -111,8 +111,8 @@ PSQLA_PrivInit(void)
PSQLA_EOAttribute_allocWithZoneIMP=
[PSQLA_EOAttributeClass methodForSelector:@selector(allocWithZone:)];
PSQLA_Postgres95Values_newValueForBytesLengthAttributeIMP=
[PSQLA_Postgres95ValuesClass methodForSelector:@selector(newValueForBytes:length:attribute:)];
PSQLA_PostgresValues_newValueForBytesLengthAttributeIMP=
[PSQLA_PostgresValuesClass methodForSelector:@selector(newValueForBytes:length:attribute:)];
// ==== Constants ====
ASSIGN(PSQLA_NSNumberBool_Yes,[PSQLA_NSNumberClass numberWithBool:YES]);

View file

@ -1,5 +1,5 @@
/*
Postgres95SQLExpression.h
PostgresSQLExpression.h
Copyright (C) 2000,2002,2003,2004,2005 Free Software Foundation, Inc.
@ -24,8 +24,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __Postgres95SQLExpression_h__
#define __Postgres95SQLExpression_h__
#ifndef __PostgresSQLExpression_h__
#define __PostgresSQLExpression_h__
#include <EOAccess/EOSQLExpression.h>
@ -33,7 +33,7 @@
@class NSString;
@interface Postgres95SQLExpression : EOSQLExpression
@interface PostgresSQLExpression : EOSQLExpression
+ (NSString *)formatValue: (id)value
forAttribute: (EOAttribute *)attribute;
@ -53,4 +53,4 @@
@end
#endif /* __Postgres95SQLExpression_h__ */
#endif /* __PostgresSQLExpression_h__ */

View file

@ -1,5 +1,5 @@
/**
Postgres95SQLExpression.m <title>Postgres95SQLExpression</title>
PostgresSQLExpression.m <title>PostgresSQLExpression</title>
Copyright (C) 2000-2002,2003,2004,2005 Free Software Foundation, Inc.
@ -61,12 +61,12 @@ RCS_ID("$Id$")
#include <EOAccess/EOModel.h>
#include <EOAccess/EOSchemaGeneration.h>
#include "Postgres95SQLExpression.h"
#include "Postgres95Adaptor.h"
#include "Postgres95Values.h"
#include "PostgresSQLExpression.h"
#include "PostgresAdaptor.h"
#include "PostgresValues.h"
#include "Postgres95Compatibility.h"
#include "Postgres95Private.h"
#include "PostgresCompatibility.h"
#include "PostgresPrivate.h"
/* These methods are undocumented but exist in GDL2 and WO4.5.
Ayers: Review (Don't rely on them) */
@ -80,7 +80,7 @@ RCS_ID("$Id$")
@end
@implementation Postgres95SQLExpression
@implementation PostgresSQLExpression
+ (void) initialize
{

View file

@ -1,5 +1,5 @@
/*
Postgres95Values.h
PostgresValues.h
Copyright (C) 2000,2002,2003,2004,2005 Free Software Foundation, Inc.
@ -24,8 +24,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __Postgres95Values_h__
#define __Postgres95Values_h__
#ifndef __PostgresValues_h__
#define __PostgresValues_h__
#ifdef GNUSTEP
#include <Foundation/NSString.h>
@ -38,10 +38,10 @@
#endif
@class EOAttribute;
@class Postgres95Channel;
@class PostgresChannel;
@interface Postgres95Values:NSObject
@interface PostgresValues:NSObject
{
}
@ -68,4 +68,4 @@
@end
#endif /* __Postgres95Values_h__ */
#endif /* __PostgresValues_h__ */

View file

@ -1,5 +1,5 @@
/**
Postgres95Values.m
PostgresValues.m
Copyright (C) 2000-2002,2003,2004,2005 Free Software Foundation, Inc.
@ -55,16 +55,16 @@ RCS_ID("$Id$")
#include <EOAccess/EOAttribute.h>
#include "Postgres95EOAdaptor/Postgres95Adaptor.h"
#include "Postgres95EOAdaptor/Postgres95Channel.h"
#include "Postgres95EOAdaptor/Postgres95Values.h"
#include "PostgresEOAdaptor/PostgresAdaptor.h"
#include "PostgresEOAdaptor/PostgresChannel.h"
#include "PostgresEOAdaptor/PostgresValues.h"
#include "Postgres95Compatibility.h"
#include "Postgres95Private.h"
#include "PostgresCompatibility.h"
#include "PostgresPrivate.h"
#include <stdlib.h>
void __postgres95_values_linking_function (void)
void __postgres_values_linking_function (void)
{
}
@ -77,7 +77,7 @@ static NSStringEncoding LPSQLA_StringDefaultCStringEncoding;
- (char)_valueTypeChar;
@end
@implementation Postgres95Values
@implementation PostgresValues
+ (void) initialize
{
@ -290,18 +290,18 @@ For efficiency reasons, the returned value is NOT autoreleased !
@end
/*
@implementation NSString (Postgres95ValueCreation)
@implementation NSString (PostgresValueCreation)
For efficiency reasons, the returned value is NOT autoreleased !
- stringValueForPostgres95Type:(NSString*)type
- stringValueForPostgresType:(NSString*)type
attribute:(EOAttribute*)attribute
{
if ([type isEqual:@"bytea"])
return [[NSData alloc]initWithBytes:[self cString]
length:[self cStringLength]]
stringValueForPostgres95Type:type
stringValueForPostgresType:type
attribute:attribute];
else
return [[[[EOQuotedExpression alloc]
@ -313,13 +313,13 @@ if ([type isEqual:@"bytea"])
return nil;
}
@end // NSString (Postgres95ValueCreation)
@end // NSString (PostgresValueCreation)
@implementation NSNumber (Postgres95ValueCreation)
@implementation NSNumber (PostgresValueCreation)
- stringValueForPostgres95Type:(NSString*)type
- stringValueForPostgresType:(NSString*)type
attribute:(EOAttribute*)attribute;
{
if ([[attribute externalType] isEqualToString:@"bool"])
@ -328,13 +328,13 @@ if ([type isEqual:@"bytea"])
return [self description];
}
@end // NSNumber (Postgres95ValueCreation)
@end // NSNumber (PostgresValueCreation)
@implementation NSData (Postgres95ValueCreation)
@implementation NSData (PostgresValueCreation)
- stringValueForPostgres95Type:(NSString*)type
- stringValueForPostgresType:(NSString*)type
attribute:(EOAttribute*)attribute
{
if ([[attribute externalType] isEqualToString:@"bytea"]) {
@ -366,29 +366,29 @@ if ([type isEqual:@"bytea"])
}
return [[NSString stringWithCString:[self bytes] length:[self length]]
stringValueForPostgres95Type:type attribute:attribute];
stringValueForPostgresType:type attribute:attribute];
}
@end // NSData (Postgres95ValueCreation)
@end // NSData (PostgresValueCreation)
*/
@implementation NSCalendarDate (Postgres95ValueCreation)
@implementation NSCalendarDate (PostgresValueCreation)
+ (NSString*)postgres95Format
+ (NSString*)postgresFormat
{
NSLog(@"%@ - is deprecated. The adaptor always uses ISO format.",
NSStringFromSelector(_cmd));
return PSQLA_postgresCalendarFormat;
}
@end // NSCalendarDate (Postgres95ValueCreation)
@end // NSCalendarDate (PostgresValueCreation)
/*
@implementation EONull (Postgres95ValueCreation)
@implementation EONull (PostgresValueCreation)
- stringValueForPostgres95Type:(NSString*)type
- stringValueForPostgresType:(NSString*)type
attribute:(EOAttribute*)attribute
{
return @"NULL";
@ -397,25 +397,25 @@ if ([type isEqual:@"bytea"])
@end
@implementation NSObject (Postgres95ValueCreation)
@implementation NSObject (PostgresValueCreation)
- stringValueForPostgres95Type:(NSString*)type
- stringValueForPostgresType:(NSString*)type
attribute:(EOAttribute*)attribute
{
if ([self respondsToSelector:@selector(stringForType:)])
return [[self stringForType:[attribute valueType]]
stringValueForPostgres95Type:type attribute:attribute];
stringValueForPostgresType:type attribute:attribute];
else if ([self respondsToSelector:@selector(dataForType:)])
return [[self dataForType:[attribute valueType]]
stringValueForPostgres95Type:type attribute:attribute];
stringValueForPostgresType:type attribute:attribute];
else
THROW([[DataTypeMappingNotSupportedException alloc]
initWithFormat:@"Postgres95 cannot map value class %@ "
initWithFormat:@"Postgres cannot map value class %@ "
@"because its instances does not responds to either "
@" `stringForType:' or `dataForType:'. ",
NSStringFromClass([self class])]);
return nil;
}
@end // NSObject (Postgres95ValueCreation)
@end // NSObject (PostgresValueCreation)
*/

View file

@ -138,15 +138,15 @@ usage(BOOL fullUsage)
"\tset to connectionDictionary.\n"
"\n"
"\t model -- must be the name of an eomodel or eomodeld file\n"
"\t adaptorName -- Postgres95, FlatFile, etc.\n"
"\t adaptorName -- Postgres, FlatFile, etc.\n"
"\t connectionDictionary -- string in property list format representing a\n"
"\t dictionary, specifying the database name for the\n"
"\t data source (required) and username and password (if\n"
"\t required by that data source).\n"
"\t outFileName -- the name of a directory to write the converted model\n"
"\n"
"\tExample: eoutil convert Movies.eomodeld Postgres95 '{ databaseName = test; hostName = localhost; userName = postgres; password = postgres; }' M.eomodeld\n"
"\t Converts types in Movies.eomodeld file to Postgres95 types and writes\n"
"\tExample: eoutil convert Movies.eomodeld Postgres '{ databaseName = test; hostName = localhost; userName = postgres; password = postgres; }' M.eomodeld\n"
"\t Converts types in Movies.eomodeld file to Postgres types and writes\n"
"\t the converted model to ./M.eomodel\n"
"\n"
" eoutil connect (<model> | (<adaptorName> <connectionDictionary>))\n"
@ -156,13 +156,13 @@ usage(BOOL fullUsage)
"\tprimarily useful for scripts.\n"
"\n"
"\t model -- must be the name of an eomodel or eomodeld file\n"
"\t adaptorName -- Postgres95, FlatFile, etc.\n"
"\t adaptorName -- Postgres, FlatFile, etc.\n"
"\t connectionDictionary -- string in property list format representing a\n"
"\t dictionary, specifying the database name for the\n"
"\t data source (required) and username and password (if\n"
"\t required by that data source).\n"
"\n"
"\tExample: eoutil connect Postgres95 '{ databaseName = test; hostName = localhost; userName = postgres; password = postgres; }'\n"
"\tExample: eoutil connect Postgres '{ databaseName = test; hostName = localhost; userName = postgres; password = postgres; }'\n"
"\t Attempts to connect to a Postgres database on host localhost.\n"
"\n"
" eoutil help\n"