59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#import "common.h"
-#import "MySQL4Adaptor.h"
-#import "MySQL4Context.h"
-#import "MySQL4Channel.h"
-#import "MySQL4Expression.h"
-#import "MySQL4Values.h"
+#include "MySQL4Adaptor.h"
+#include "MySQL4Context.h"
+#include "MySQL4Channel.h"
+#include "MySQL4Expression.h"
+#include "MySQL4Values.h"
+#include "common.h"
@implementation MySQL4Adaptor
-- (NSDictionary *)connectionDictionaryForNSURL:(NSURL *)_url {
- /*
- "Database URLs"
-
- We use the schema:
- MySQL43://localhost/dbpath/foldername
- */
- NSMutableDictionary *md;
- NSString *p;
-
- if ((p = [_url path]) == nil)
- return nil;
-
- p = [p stringByDeletingLastPathComponent];
- if ([p length] == 0) p = [_url path];
-
- md = [NSMutableDictionary dictionaryWithCapacity:8];
- [md setObject:p forKey:@"databaseName"];
- return md;
-}
-
- (id)initWithName:(NSString *)_name {
if ((self = [super initWithName:_name])) {
}
- (id)formatValue:(id)value forAttribute:(EOAttribute *)attribute {
NSString *result;
- result = [value stringValueForMySQL43Type:[attribute externalType]
+ result = [value stringValueForMySQL4Type:[attribute externalType]
attribute:attribute];
//NSLog(@"formatting value %@ result %@", value, result);
- (void)channelDidInit:_channel {
if ([channels count] > 0) {
[NSException raise:@"TooManyOpenChannelsException"
- format:@"MySQL43 only supports one channel per context"];
+ format:@"MySQL4 only supports one channel per context"];
}
[super channelDidInit:_channel];
}
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef ___MySQL43_SQLExpression_H___
-#define ___MySQL43_SQLExpression_H___
+#ifndef ___MySQL4_SQLExpression_H___
+#define ___MySQL4_SQLExpression_H___
#include <GDLAccess/EOSQLExpression.h>
@end
-#endif /* ___MySQL43_SQLExpression_H___ */
+#endif /* ___MySQL4_SQLExpression_H___ */
- (id)initWithObject:(id)_obj
forAttribute:(EOAttribute *)_attr
- andMySQL43Type:(NSString *)_dt
+ andMySQL4Type:(NSString *)_dt
inChannel:(MySQL4Channel *)_channel;
@end
@protocol MySQL4Values
-- (NSString *)stringValueForMySQL43Type:(NSString *)_type
+- (NSString *)stringValueForMySQL4Type:(NSString *)_type
attribute:(EOAttribute *)_attribute;
@end
@interface EONull(MySQL4Values)
-- (NSString *)stringValueForMySQL43Type:(NSString *)_type
+- (NSString *)stringValueForMySQL4Type:(NSString *)_type
attribute:(EOAttribute *)_attribute;
@end
- (id)initWithObject:(id)_obj
forAttribute:(EOAttribute *)_attr
- andMySQL43Type:(NSString *)_dt
+ andMySQL4Type:(NSString *)_dt
inChannel:(MySQL4Channel *)_channel;
{
NSDictionary *ui;
@implementation NSNull(MySQL4Values)
-- (NSString *)stringValueForMySQL43Type:(NSString *)_type
+- (NSString *)stringValueForMySQL4Type:(NSString *)_type
attribute:(EOAttribute *)_attribute
{
return @"null";
/* generating value */
-- (NSString *)stringValueForMySQL43Type:(NSString *)_type
+- (NSString *)stringValueForMySQL4Type:(NSString *)_type
attribute:(EOAttribute *)_attribute
{
#if 0
return [self initWithBytes:_value length:_length];
}
-- (NSString *)stringValueForMySQL43Type:(NSString *)_type
+- (NSString *)stringValueForMySQL4Type:(NSString *)_type
attribute:(EOAttribute *)_attribute
{
// TODO: UNICODE
[t hasPrefix:@"varchar"] ||
[t hasPrefix:@"money"] ||
[t hasPrefix:@"text"]) {
- t = [[str stringValueForMySQL43Type:_type
+ t = [[str stringValueForMySQL4Type:_type
attribute:_attribute] retain];
[str release];
return [t autorelease];
return nil;
}
-- (NSString *)stringValueForMySQL43Type:(NSString *)_type
+- (NSString *)stringValueForMySQL4Type:(NSString *)_type
attribute:(EOAttribute *)_attribute
{
// TODO: can we avoid the lowercaseString?
/* generate SQL value */
-- (NSString *)stringValueForMySQL43Type:(NSString *)_type
+- (NSString *)stringValueForMySQL4Type:(NSString *)_type
attribute:(EOAttribute *)_attribute
{
// TODO: all this looks slow ...
Author: Helge Hess (helge@mdlink.de)
- This file is part of the MySQL43 Adaptor Library
+ This file is part of the MySQL4 Adaptor Library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef ___MySQL43_common_H___
-#define ___MySQL43_common_H___
+#ifndef ___MySQL4_common_H___
+#define ___MySQL4_common_H___
#import <objc/objc-api.h>
#include <GDLAccess/GDLAccess.h>
#include <NGExtensions/NGExtensions.h>
-#endif /* ___MySQL43_common_H___ */
+#endif /* ___MySQL4_common_H___ */
conDict = [NSDictionary dictionaryWithContentsOfFile:@"condict.plist"];
NSLog(@"condict is %@", conDict);
- if ((a = [EOAdaptor adaptorWithName:@"MySQL43"]) == nil) {
- NSLog(@"found no MySQL43 adaptor ..");
+ if ((a = [EOAdaptor adaptorWithName:@"MySQL4"]) == nil) {
+ NSLog(@"found no MySQL4 adaptor ..");
exit(1);
}