This chapter describes the data types and constants found in MacSQL Framework.
typedef struct RTSQLDateTimeType {
UInt16 year;
UInt8 month;
UInt8 day;
UInt8 hour;
UInt8 minute;
UInt8 second;
SInt8 padding;
UInt32 milliseconds;
} RTSQLDateTimeType;
Structure internally used to represent date/time values. Can be specified as the native type to return values of RTSQLType_Date, RTSQLType_Time, and RTSQLType_DateTime as.
const UInt32 RTSQLType_String;
const UInt32 RTSQLType_Boolean;
const UInt32 RTSQLType_Number;
const UInt32 RTSQLType_FloatNumber;
const UInt32 RTSQLType_BigInt;
const UInt32 RTSQLType_Decimal;
const UInt32 RTSQLType_Date;
const UInt32 RTSQLType_Time;
const UInt32 RTSQLType_DateTime;
const UInt32 RTSQLType_Blob;
const UInt32 RTSQLType_TextBlob;
const UInt32 RTSQLType_Unknown;
These constants declare the "native data type constants" the MacSQL Framework uses to distinguish the different types of data a database can return. Each of these types has a specific list of classes (or in one case, struct) that data of this type can be returned as. The first class type listed is the default for RTSQLDataType objects.
| RTSQLType_String | NSString |
| RTSQLType_Boolean | NSNumber, CFBooleanRef |
| RTSQLType_Number | NSNumber, NSString |
| RTSQLType_FloatNumber | NSNumber, NSString |
| RTSQLType_BigInt | NSNumber, NSString |
| RTSQLType_Decimal | NSDecimalNumber, NSNumber, NSString |
| RTSQLType_Date | NSCalendarDate, RTSQLDateTimeType, NSString (YYYY/MM/DD) |
| RTSQLType_Time | NSString (HI:MM:SS), RTSQLDateTimeType, NSCalendarDate (with the day as 2001/01/01) |
| RTSQLTime_DateTime | NSCalendarDate, RTSQLDateTimeType, NSString (YYYY/MM/DD HI:MM:SS) |
| RTSQLType_Blob | NSData |
| RTSQLType_TextBlob | NSString |
| RTSQLType_Unknown | nil |
In addition to the exceptions listed below, the MacSQL Framework can also throw
Foundation exceptions such as NSInvalidArgumentException and
NSInternalInconsistencyException.
NSString *RTQueryFailedException;
Name of exception raised when a query fails.
NSString *RTFeatureNotImplementedException;
Name of exception raised when a requested action is not implemented (either the plugin or remote server does not support the operation).
NSString *RTInvalidPluginNameException;
Name of exception raised when a connection is asked to be open to a invalid plugin.
NSString *RTFailedToLoadPluginException;
Name of exception raised when a plugin fails to load.
NSString *RTFailedToCreateSessionException;
Name of exception raised when a session fails to open.
NSString *RTPluginNotLoadedException;
Name of exception raised when a message is sent to a plugin that is not yet loaded.
NSString *RTIllegalDataTypeException;
Name of exception raised when an RTSQLDataType is asked to use an unsupported native data type class (such as asking a string to be returned as an NSCalendarDate.
NSString *RTTableHasNoPrimaryKeyException;
Name of exception raised when a data source is asked to use a table that does not have a primary key, but that data source requires one.
NSString *RTNoPrimaryKeyValueException;
Name of exception raised when a row is inserted into a data source and a primary key value was not supplied by the user/programmer or autogenerated by the server.