- Inherits From:
- NSObject
- Declared In:
- MacSQLFactory.h
- + 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:
+ (MacSQLFactory *)defaultInstance
No method description.
- (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.
- (NSString*)dateFormatString
Returns the format string used with an NSDateFormatter when converting dates to strings. Defaults to the NSUserDefaults value for NSShortDateFormatString.
- (NSString*)dateTimeFormatString
Returns the format string used with an NSDateFormatter when converting datetimes to strings. Defaults to the NSUserDefaults value for NSShortTimeDateFormatString.
- (NSTimeZone*)defaultTimeZone
Returns the NSTimeZone used when allocating NSCalendarDate objects for row values.
- (id<MacSQLLogReception>)logDelegate
Returns the log delegate that will get messages when a noteworthy event has happened.
- (BOOL)loggingEnabled
If YES, various information will be set to the console including error messages and queries.
- (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.
- (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.
- (id <RTSQLPlugin>)pluginNamed:(NSString*)name
Returns the plugin with the specified name
- (NSArray*)pluginNames
Returns array of names of all available plugins (i.e. for use in a menu of database types.
- (id <RTSQLPlugin>)pluginWithTypeConstant:(FourCharCode)constant
Returns the plugin with the specified type constant
- (NSArray*)plugins
Returns an NSArray containing the available plugins
- (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:
| DefaultPlugin | name of plugin to select by default |
| ExcludePlugins | NSArray of plugin names to not offer |
| LoadPlugins | if exists, will only offer loaded/loadable plugins |
- (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:
| DefaultPlugin | name of plugin to select by default |
| ExcludePlugins | NSArray of plugin names to not offer |
| LoadPlugins | if exists, will only offer loaded/loadable plugins |
- (void)setDateFormatString:(NSString*)format
Sets the format string used with an NSDateFormatter when converting dates to strings.
- (void)setDateTimeFormatString:(NSString*)format
Sets the format string used with an NSDateFormatter when converting datetimes to strings.
- (void)setDefaultTimeZone:(NSTimeZone*)timeZone
Sets the NSTimeZone used when allocating NSCalendarDate objects for row values.
- (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].
- (void)setLoggingEnabled:(BOOL)enable
If YES, various information will be set to the console including error messages and queries.
- (void)setTimeFormatString:(NSString*)format
Sets the format string used with an NSDateFormatter when converting times to strings.
- (NSString*)timeFormatString
Returns the format string used with an NSDateFormatter when converting times to strings. Defaults to the NSUserDefaults value for NSTimeFormatString.