libs-gdl2/EOAdaptors/PostgreSQLAdaptor/PostgreSQLPrivate.m

119 lines
3.5 KiB
Mathematica
Raw Normal View History

* EOAdaptors/Postgres95/Postgres95Private.m/h: New files based on EOControl/EOPriv.m/h. * EOAdaptors/Postgres95/GNUmakefile.in: Build Postgres95Private.m. * EOAdaptors/Postgres95/Postgres95Adaptor.m: Do not depend on EOControl/EOPriv.m/h but on own private files. (+assignExternalInfoForEntity): Use objectAtIndex: instead of enumerator for speed. * EOAdaptors/Postgres95/Postgres95Channel.m: (+initialize) (-lowLevelResultFieldNames:, -fetchRowWithZone:) (-insertRow:forEntity:, -_describeResults, -describeTableNames) (-updateValues:inRowsDescribedByQualifier:entity:) (-_describeBasicEntityWithName:forModel:) (-_describeForeignKeysForEntity:forModel:) (-primaryKeyForNewRowWithEntity:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. (pgResultDictionary): Simplify unused static local be reverting optimizations. * EOAdaptors/Postgres95/Postgres95SQLExpression.m: (+initialize, +formatValue:forAttribute:) (+sqlPatternFromShellPattern:) (+sqlPatternFromShellPattern:withEscapeCharacter:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. * EOAdaptors/Postgres95/Postgres95Values.h/m (Postgres95CalendarFormat, Postgres95ValuesClass) (Postgres95Values_newValueForBytesLengthAttributeSEL) (Postgres95Values_newValueForBytesLengthAttributeIMP) (Postgres95Values_newValueForBytesLengthAttribute): Remove. ([NSCalendarDate+setPostgres95Format:]): Remove. ([NSCalendarDate+postgres95Format]): Deprecate. (LPSQLA_StringDefaultCStringEncoding): New local static. (+initialize, +newValueForNumberType:length:attribute:) (+newValueForCharactersType:length:attribute:) (+newValueForDateType:length:attribute:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20750 72102866-910b-0410-8b05-ffd578937521
2005-02-19 12:13:22 +00:00
/**
PostgreSQLPrivate.m <title>PostgreSQLPrivate: various definitions</title>
* EOAdaptors/Postgres95/Postgres95Private.m/h: New files based on EOControl/EOPriv.m/h. * EOAdaptors/Postgres95/GNUmakefile.in: Build Postgres95Private.m. * EOAdaptors/Postgres95/Postgres95Adaptor.m: Do not depend on EOControl/EOPriv.m/h but on own private files. (+assignExternalInfoForEntity): Use objectAtIndex: instead of enumerator for speed. * EOAdaptors/Postgres95/Postgres95Channel.m: (+initialize) (-lowLevelResultFieldNames:, -fetchRowWithZone:) (-insertRow:forEntity:, -_describeResults, -describeTableNames) (-updateValues:inRowsDescribedByQualifier:entity:) (-_describeBasicEntityWithName:forModel:) (-_describeForeignKeysForEntity:forModel:) (-primaryKeyForNewRowWithEntity:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. (pgResultDictionary): Simplify unused static local be reverting optimizations. * EOAdaptors/Postgres95/Postgres95SQLExpression.m: (+initialize, +formatValue:forAttribute:) (+sqlPatternFromShellPattern:) (+sqlPatternFromShellPattern:withEscapeCharacter:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. * EOAdaptors/Postgres95/Postgres95Values.h/m (Postgres95CalendarFormat, Postgres95ValuesClass) (Postgres95Values_newValueForBytesLengthAttributeSEL) (Postgres95Values_newValueForBytesLengthAttributeIMP) (Postgres95Values_newValueForBytesLengthAttribute): Remove. ([NSCalendarDate+setPostgres95Format:]): Remove. ([NSCalendarDate+postgres95Format]): Deprecate. (LPSQLA_StringDefaultCStringEncoding): New local static. (+initialize, +newValueForNumberType:length:attribute:) (+newValueForCharactersType:length:attribute:) (+newValueForDateType:length:attribute:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20750 72102866-910b-0410-8b05-ffd578937521
2005-02-19 12:13:22 +00:00
Copyright (C) 2005 Free Software Foundation, Inc.
Date: Jan 2005
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Database Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
* EOAdaptors/Postgres95/Postgres95Private.m/h: New files based on EOControl/EOPriv.m/h. * EOAdaptors/Postgres95/GNUmakefile.in: Build Postgres95Private.m. * EOAdaptors/Postgres95/Postgres95Adaptor.m: Do not depend on EOControl/EOPriv.m/h but on own private files. (+assignExternalInfoForEntity): Use objectAtIndex: instead of enumerator for speed. * EOAdaptors/Postgres95/Postgres95Channel.m: (+initialize) (-lowLevelResultFieldNames:, -fetchRowWithZone:) (-insertRow:forEntity:, -_describeResults, -describeTableNames) (-updateValues:inRowsDescribedByQualifier:entity:) (-_describeBasicEntityWithName:forModel:) (-_describeForeignKeysForEntity:forModel:) (-primaryKeyForNewRowWithEntity:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. (pgResultDictionary): Simplify unused static local be reverting optimizations. * EOAdaptors/Postgres95/Postgres95SQLExpression.m: (+initialize, +formatValue:forAttribute:) (+sqlPatternFromShellPattern:) (+sqlPatternFromShellPattern:withEscapeCharacter:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. * EOAdaptors/Postgres95/Postgres95Values.h/m (Postgres95CalendarFormat, Postgres95ValuesClass) (Postgres95Values_newValueForBytesLengthAttributeSEL) (Postgres95Values_newValueForBytesLengthAttributeIMP) (Postgres95Values_newValueForBytesLengthAttribute): Remove. ([NSCalendarDate+setPostgres95Format:]): Remove. ([NSCalendarDate+postgres95Format]): Deprecate. (LPSQLA_StringDefaultCStringEncoding): New local static. (+initialize, +newValueForNumberType:length:attribute:) (+newValueForCharactersType:length:attribute:) (+newValueForDateType:length:attribute:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20750 72102866-910b-0410-8b05-ffd578937521
2005-02-19 12:13:22 +00:00
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* EOAdaptors/Postgres95/Postgres95Private.m/h: New files based on EOControl/EOPriv.m/h. * EOAdaptors/Postgres95/GNUmakefile.in: Build Postgres95Private.m. * EOAdaptors/Postgres95/Postgres95Adaptor.m: Do not depend on EOControl/EOPriv.m/h but on own private files. (+assignExternalInfoForEntity): Use objectAtIndex: instead of enumerator for speed. * EOAdaptors/Postgres95/Postgres95Channel.m: (+initialize) (-lowLevelResultFieldNames:, -fetchRowWithZone:) (-insertRow:forEntity:, -_describeResults, -describeTableNames) (-updateValues:inRowsDescribedByQualifier:entity:) (-_describeBasicEntityWithName:forModel:) (-_describeForeignKeysForEntity:forModel:) (-primaryKeyForNewRowWithEntity:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. (pgResultDictionary): Simplify unused static local be reverting optimizations. * EOAdaptors/Postgres95/Postgres95SQLExpression.m: (+initialize, +formatValue:forAttribute:) (+sqlPatternFromShellPattern:) (+sqlPatternFromShellPattern:withEscapeCharacter:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. * EOAdaptors/Postgres95/Postgres95Values.h/m (Postgres95CalendarFormat, Postgres95ValuesClass) (Postgres95Values_newValueForBytesLengthAttributeSEL) (Postgres95Values_newValueForBytesLengthAttributeIMP) (Postgres95Values_newValueForBytesLengthAttribute): Remove. ([NSCalendarDate+setPostgres95Format:]): Remove. ([NSCalendarDate+postgres95Format]): Deprecate. (LPSQLA_StringDefaultCStringEncoding): New local static. (+initialize, +newValueForNumberType:length:attribute:) (+newValueForCharactersType:length:attribute:) (+newValueForDateType:length:attribute:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20750 72102866-910b-0410-8b05-ffd578937521
2005-02-19 12:13:22 +00:00
</license>
**/
#include "config.h"
RCS_ID("$Id$")
#include <Foundation/Foundation.h>
#ifndef GNUSTEP
#include <GNUstepBase/GNUstep.h>
#include <GNUstepBase/GSCategories.h>
#endif
#include <EOControl/EONull.h>
#include <EOAccess/EOAttribute.h>
// ==== Classes ====
Class PSQLA_NSStringClass=Nil;
Class PSQLA_NSNumberClass=Nil;
Class PSQLA_NSDecimalNumberClass=Nil;
Class PSQLA_NSCalendarDateClass=Nil;
Class PSQLA_NSDateClass=Nil;
Class PSQLA_NSMutableArrayClass;
Class PSQLA_EOAttributeClass=Nil;
// ==== IMPs ====
IMP PSQLA_NSNumber_allocWithZoneIMP=NULL;
IMP PSQLA_NSDecimalNumber_allocWithZoneIMP=NULL;
IMP PSQLA_NSString_allocWithZoneIMP=NULL;
IMP PSQLA_NSCalendarDate_allocWithZoneIMP=NULL;
IMP PSQLA_NSMutableArray_allocWithZoneIMP=NULL;
IMP PSQLA_EOAttribute_allocWithZoneIMP=NULL;
// ==== Constants ====
NSNumber *PSQLA_NSNumberBool_Yes=nil;
NSNumber *PSQLA_NSNumberBool_No=nil;
EONull *PSQLA_EONull=nil;
NSArray *PSQLA_NSArray=nil;
NSString *PSQLA_postgresCalendarFormat=@"%Y-%m-%d %H:%M:%S.%F %z";
* EOAdaptors/Postgres95/Postgres95Private.m/h: New files based on EOControl/EOPriv.m/h. * EOAdaptors/Postgres95/GNUmakefile.in: Build Postgres95Private.m. * EOAdaptors/Postgres95/Postgres95Adaptor.m: Do not depend on EOControl/EOPriv.m/h but on own private files. (+assignExternalInfoForEntity): Use objectAtIndex: instead of enumerator for speed. * EOAdaptors/Postgres95/Postgres95Channel.m: (+initialize) (-lowLevelResultFieldNames:, -fetchRowWithZone:) (-insertRow:forEntity:, -_describeResults, -describeTableNames) (-updateValues:inRowsDescribedByQualifier:entity:) (-_describeBasicEntityWithName:forModel:) (-_describeForeignKeysForEntity:forModel:) (-primaryKeyForNewRowWithEntity:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. (pgResultDictionary): Simplify unused static local be reverting optimizations. * EOAdaptors/Postgres95/Postgres95SQLExpression.m: (+initialize, +formatValue:forAttribute:) (+sqlPatternFromShellPattern:) (+sqlPatternFromShellPattern:withEscapeCharacter:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. * EOAdaptors/Postgres95/Postgres95Values.h/m (Postgres95CalendarFormat, Postgres95ValuesClass) (Postgres95Values_newValueForBytesLengthAttributeSEL) (Postgres95Values_newValueForBytesLengthAttributeIMP) (Postgres95Values_newValueForBytesLengthAttribute): Remove. ([NSCalendarDate+setPostgres95Format:]): Remove. ([NSCalendarDate+postgres95Format]): Deprecate. (LPSQLA_StringDefaultCStringEncoding): New local static. (+initialize, +newValueForNumberType:length:attribute:) (+newValueForCharactersType:length:attribute:) (+newValueForDateType:length:attribute:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20750 72102866-910b-0410-8b05-ffd578937521
2005-02-19 12:13:22 +00:00
// ==== Init Method ====
void
PSQLA_PrivInit(void)
{
static BOOL initialized=NO;
if (!initialized)
{
initialized = YES;
* EOAdaptors/Postgres95/Postgres95Private.m/h: New files based on EOControl/EOPriv.m/h. * EOAdaptors/Postgres95/GNUmakefile.in: Build Postgres95Private.m. * EOAdaptors/Postgres95/Postgres95Adaptor.m: Do not depend on EOControl/EOPriv.m/h but on own private files. (+assignExternalInfoForEntity): Use objectAtIndex: instead of enumerator for speed. * EOAdaptors/Postgres95/Postgres95Channel.m: (+initialize) (-lowLevelResultFieldNames:, -fetchRowWithZone:) (-insertRow:forEntity:, -_describeResults, -describeTableNames) (-updateValues:inRowsDescribedByQualifier:entity:) (-_describeBasicEntityWithName:forModel:) (-_describeForeignKeysForEntity:forModel:) (-primaryKeyForNewRowWithEntity:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. (pgResultDictionary): Simplify unused static local be reverting optimizations. * EOAdaptors/Postgres95/Postgres95SQLExpression.m: (+initialize, +formatValue:forAttribute:) (+sqlPatternFromShellPattern:) (+sqlPatternFromShellPattern:withEscapeCharacter:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. * EOAdaptors/Postgres95/Postgres95Values.h/m (Postgres95CalendarFormat, Postgres95ValuesClass) (Postgres95Values_newValueForBytesLengthAttributeSEL) (Postgres95Values_newValueForBytesLengthAttributeIMP) (Postgres95Values_newValueForBytesLengthAttribute): Remove. ([NSCalendarDate+setPostgres95Format:]): Remove. ([NSCalendarDate+postgres95Format]): Deprecate. (LPSQLA_StringDefaultCStringEncoding): New local static. (+initialize, +newValueForNumberType:length:attribute:) (+newValueForCharactersType:length:attribute:) (+newValueForDateType:length:attribute:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20750 72102866-910b-0410-8b05-ffd578937521
2005-02-19 12:13:22 +00:00
// ==== Classes ====
PSQLA_NSMutableArrayClass=[NSMutableArray class];
PSQLA_NSStringClass=[NSString class];
PSQLA_NSNumberClass=[NSNumber class];
PSQLA_NSDecimalNumberClass=[NSDecimalNumber class];
PSQLA_NSCalendarDateClass=[NSCalendarDate class];
PSQLA_NSDateClass=[NSDate class];
* EOAdaptors/Postgres95/Postgres95Private.m/h: New files based on EOControl/EOPriv.m/h. * EOAdaptors/Postgres95/GNUmakefile.in: Build Postgres95Private.m. * EOAdaptors/Postgres95/Postgres95Adaptor.m: Do not depend on EOControl/EOPriv.m/h but on own private files. (+assignExternalInfoForEntity): Use objectAtIndex: instead of enumerator for speed. * EOAdaptors/Postgres95/Postgres95Channel.m: (+initialize) (-lowLevelResultFieldNames:, -fetchRowWithZone:) (-insertRow:forEntity:, -_describeResults, -describeTableNames) (-updateValues:inRowsDescribedByQualifier:entity:) (-_describeBasicEntityWithName:forModel:) (-_describeForeignKeysForEntity:forModel:) (-primaryKeyForNewRowWithEntity:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. (pgResultDictionary): Simplify unused static local be reverting optimizations. * EOAdaptors/Postgres95/Postgres95SQLExpression.m: (+initialize, +formatValue:forAttribute:) (+sqlPatternFromShellPattern:) (+sqlPatternFromShellPattern:withEscapeCharacter:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. * EOAdaptors/Postgres95/Postgres95Values.h/m (Postgres95CalendarFormat, Postgres95ValuesClass) (Postgres95Values_newValueForBytesLengthAttributeSEL) (Postgres95Values_newValueForBytesLengthAttributeIMP) (Postgres95Values_newValueForBytesLengthAttribute): Remove. ([NSCalendarDate+setPostgres95Format:]): Remove. ([NSCalendarDate+postgres95Format]): Deprecate. (LPSQLA_StringDefaultCStringEncoding): New local static. (+initialize, +newValueForNumberType:length:attribute:) (+newValueForCharactersType:length:attribute:) (+newValueForDateType:length:attribute:): Do not depend on EOControl/EOPriv.m/h but on own private files. Improve optimizations. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20750 72102866-910b-0410-8b05-ffd578937521
2005-02-19 12:13:22 +00:00
PSQLA_EOAttributeClass = [EOAttribute class];
// ==== IMPs ====
PSQLA_NSNumber_allocWithZoneIMP=
[PSQLA_NSNumberClass methodForSelector:@selector(allocWithZone:)];
PSQLA_NSDecimalNumber_allocWithZoneIMP=
[PSQLA_NSDecimalNumberClass methodForSelector:@selector(allocWithZone:)];
PSQLA_NSString_allocWithZoneIMP=
[PSQLA_NSStringClass methodForSelector:@selector(allocWithZone:)];
PSQLA_NSCalendarDate_allocWithZoneIMP=
[PSQLA_NSCalendarDateClass methodForSelector:@selector(allocWithZone:)];
PSQLA_NSMutableArray_allocWithZoneIMP=
[PSQLA_NSMutableArrayClass methodForSelector:@selector(allocWithZone:)];
PSQLA_EOAttribute_allocWithZoneIMP=
[PSQLA_EOAttributeClass methodForSelector:@selector(allocWithZone:)];
// ==== Constants ====
ASSIGN(PSQLA_NSNumberBool_Yes,[PSQLA_NSNumberClass numberWithBool:YES]);
ASSIGN(PSQLA_NSNumberBool_No,[PSQLA_NSNumberClass numberWithBool:NO]);
ASSIGN(PSQLA_EONull,[EONull null]);
ASSIGN(PSQLA_NSArray,[NSArray array]);
};
}