RTSQLDataType


Conforms To:
NSObject
Declared In:
RTSQLDataType.h


Protocol Description

Protocol for abstracting an SQL data type


Method Types

- name
- literalPrefix
- literalSuffix
- creatable
- nativeDataTypeConstant
- nativeDataType
- setNativeDataType:
- maxColSize
- minScale
- maxScale
- preferredDisplaySize
- shouldBeQuoted
- acceptsNulls
- fixedPrecision
- autoIncrementing
- supportsUnsigned
- supportsLength
- createParams
- searchable
- searchableWithLike
- searchableWithOperator
- compareValue:toValue:
- valueAsString:
- stringToNativeType:

Instance Methods

acceptsNulls

- (BOOL)acceptsNulls

Returns YES if this data type supports NULL values. Defaults to YES if unknown.


autoIncrementing

- (BOOL)autoIncrementing

Returns YES if this data type supports a autoincrement/identity attribute. Defaults to NO.


compareValue:toValue:

- (NSComparisonResult)compareValue:(id)val1 toValue:(id)val2

Returns a NSComparisonResult after comparing two values of this data type.


creatable

- (BOOL)creatable

Returns YES if the plugin advises allowing users to create columns of this data type. NO would be returned for type aliases, system types, or types the plugin does not support.


createParams

- (NSString*)createParams

Returns a string with the parameters used for defining columns/variables of this data type (i.e. what appears in parentheses after the type name). Possible values are: (l)length, (L)length (if optional), (p)precision, (s)scale or a comma separating precision and scale.


fixedPrecision

- (BOOL)fixedPrecision

Returns YES if this this data type has a fixed size for the numeric precision. Defaults to NO.


literalPrefix

- (NSString*)literalPrefix

Returns string to use as a opening quote for values of this type when used in a SQL query.


literalSuffix

- (NSString*)literalSuffix

Returns string to use as a closing quote for values of this type when used in a SQL query.


maxColSize

- (UInt32)maxColSize

Returns the maximum size for columns of this data type. Returns zero if not-applicable to this data type.


maxScale

- (SInt32)maxScale

For types with a scale, returns the minimum scale for that type.


minScale

- (SInt32)minScale

For types with a scale, returns the minimum scale for that type.


name

- (NSString*)name

Returns a user-presentable name for this data type.


nativeDataType

- (NSString*)nativeDataType

Returns the name of the class (or struct if RTSQLDateTimeType) that will be returned for columns of this type.


nativeDataTypeConstant

- (UInt32)nativeDataTypeConstant

Returns one of the RTSQLType_XXX constants describing the format of data of this type.


preferredDisplaySize

- (SInt32)preferredDisplaySize

Returns the preferred width (in chars) of a column of this type, or 0 if unknown.


searchable

- (BOOL)searchable

Returns YES if this data type can be part of a WHERE clause. Defaults to YES.


searchableWithLike

- (BOOL)searchableWithLike

Returns YES if this data type can be used with the like operator. Defaults to NO if not specified by the plugin.


searchableWithOperator

- (BOOL)searchableWithOperator

Returns YES if this data type be can be used with the standard relational operators such as '<', '>', '<=', '>=', '=', and '<>'. Defaults to YES if not specified by the plugin.


setNativeDataType:

- (void)setNativeDataType:(NSString*)typeName

Sets the name of the class (or struct if RTSQLDateTimeType) that will be returned for columns of this type. Raises NSException if the typeName is not a supported return type for this data type.


shouldBeQuoted

- (BOOL)shouldBeQuoted

Returns YES if values of this type should be quoted when used in a SQL query.


stringToNativeType:

- (void*)stringToNativeType:(NSString*)str

Returns value of str as the type returned by -nativeDataType


supportsLength

- (BOOL)supportsLength

No method description.


supportsUnsigned

- (BOOL)supportsUnsigned

Returns YES if this data type supports adding an unsigned qualifier in column definitions. Defaults to NO.


valueAsString:

- (NSString*)valueAsString:(void*)rawVal

Returns a string representation of rawVal (which must be the class returned by nativeDataType).


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