MacSQLFactory


Inherits From:
NSObject
Declared In:
MacSQLFactory.h


Class Description

Returns the singleton instance of this class.


Method Types

+ defaultInstance
- loggingEnabled
- setLoggingEnabled:
- logDelegate
- setLogDelegate:
- defaultTimeZone
- setDefaultTimeZone:
- dateFormatString
- setDateFormatString:
- timeFormatString
- setTimeFormatString:
- dateTimeFormatString
- setDateTimeFormatString:
- pluginNames
- pluginNamed:
- pluginWithTypeConstant:
- plugins
- promptUserForConnectionInformation:finishSelector:withConfig:
- promptUserForConnection:didOpenSelector:didCancelSelector:withConfig:
- openConnection:withPort:asUser:identifiedBy:ofType:toDatabase:
- openConnection:withPort:asUser:identifiedBy:ofType:
- createSessionForCommand:


Class Methods

defaultInstance

+ (MacSQLFactory *)defaultInstance

No method description.


Instance Methods

createSessionForCommand:

- (id <RTSQLSession>)createSessionForCommand:(NSScriptCommand *)cmd

Opens a connection based on a NSScriptCommand representing a "make new sql session" Apple Event. A category is placed on NSScriptCommand that results in this method being called if a session is to be created.


dateFormatString

- (NSString*)dateFormatString

Returns the format string used with an NSDateFormatter when converting dates to strings. Defaults to the NSUserDefaults value for NSShortDateFormatString.


dateTimeFormatString

- (NSString*)dateTimeFormatString

Returns the format string used with an NSDateFormatter when converting datetimes to strings. Defaults to the NSUserDefaults value for NSShortTimeDateFormatString.


defaultTimeZone

- (NSTimeZone*)defaultTimeZone

Returns the NSTimeZone used when allocating NSCalendarDate objects for row values.


logDelegate

- (id<MacSQLLogReception>)logDelegate

Returns the log delegate that will get messages when a noteworthy event has happened.


loggingEnabled

- (BOOL)loggingEnabled

If YES, various information will be set to the console including error messages and queries.


openConnection:withPort:asUser:identifiedBy:ofType:

- (id <RTSQLSession>)openConnection:(NSString*)host withPort:(UInt16)port asUser:(NSString*)user identifiedBy:(NSString*)password ofType:(NSString*)databaseType

Opens and returns a session with the specified connection information.


openConnection:withPort:asUser:identifiedBy:ofType:toDatabase:

- (id <RTSQLSession>)openConnection:(NSString*)host withPort:(UInt16)port asUser:(NSString*)user identifiedBy:(NSString*)password ofType:(NSString*)databaseType toDatabase:(NSString*)dbName

Opens and returns a session with the specified connection information.


pluginNamed:

- (id <RTSQLPlugin>)pluginNamed:(NSString*)name

Returns the plugin with the specified name


pluginNames

- (NSArray*)pluginNames

Returns array of names of all available plugins (i.e. for use in a menu of database types.


pluginWithTypeConstant:

- (id <RTSQLPlugin>)pluginWithTypeConstant:(FourCharCode)constant

Returns the plugin with the specified type constant


plugins

- (NSArray*)plugins

Returns an NSArray containing the available plugins


promptUserForConnection:didOpenSelector:didCancelSelector:withConfig:

- (id<RTSQLSession>)promptUserForConnection:(id)caller didOpenSelector:(SEL)successAction didCancelSelector:(SEL)cancelAction withConfig:(NSDictionary*)config

Display a panel asking the user for connection information. This will run a modal panel. Once done, the appropriate action will be taken on caller . nil may be passed as they cancelAction. The new session will be passed to the successAction, so it must take a parameter if implemented. Either way, if a sessin is opened, it will be returned. config specifies a dictionary with optional keys that control behavior:
DefaultPluginname of plugin to select by default
ExcludePluginsNSArray of plugin names to not offer
LoadPluginsif exists, will only offer loaded/loadable plugins


promptUserForConnectionInformation:finishSelector:withConfig:

- (void)promptUserForConnectionInformation:(id)caller finishSelector:(SEL)doneSelector withConfig:(NSDictionary*)config

Display a panel asking the user for connection information. This will run a modal panel. Once completed, the selector will be called with a dictionary of connection information, or nil if they canceled. config specifies a dictionary with optional keys that control behavior:
DefaultPluginname of plugin to select by default
ExcludePluginsNSArray of plugin names to not offer
LoadPluginsif exists, will only offer loaded/loadable plugins


setDateFormatString:

- (void)setDateFormatString:(NSString*)format

Sets the format string used with an NSDateFormatter when converting dates to strings.


setDateTimeFormatString:

- (void)setDateTimeFormatString:(NSString*)format

Sets the format string used with an NSDateFormatter when converting datetimes to strings.


setDefaultTimeZone:

- (void)setDefaultTimeZone:(NSTimeZone*)timeZone

Sets the NSTimeZone used when allocating NSCalendarDate objects for row values.


setLogDelegate:

- (void)setLogDelegate:(id<MacSQLLogReception>)delegate

Sets the log delegate. The delegate is not retained so this should be called with a nil value when the delegate goes out of scope (normally in its -dealloc implementation. Setting this to nil (the default) causes messages to be sent to standard error. This method also calls [self setLoggingEnabled: YES].


setLoggingEnabled:

- (void)setLoggingEnabled:(BOOL)enable

If YES, various information will be set to the console including error messages and queries.


setTimeFormatString:

- (void)setTimeFormatString:(NSString*)format

Sets the format string used with an NSDateFormatter when converting times to strings.


timeFormatString

- (NSString*)timeFormatString

Returns the format string used with an NSDateFormatter when converting times to strings. Defaults to the NSUserDefaults value for NSTimeFormatString.


Copyright ©2006 by Runtime Labs, Inc.. All Rights Reserved.