Types and Constants


This chapter describes the data types and constants found in MacSQL Framework.

"Data Types"
"Global Variables"
"Exceptions"


Data Types

typedef struct RTSQLDateTimeType {    
    UInt16 year;
    UInt8 month;
    UInt8 day;
    UInt8 hour;
    UInt8 minute;
    UInt8 second;
    SInt8 padding;
    UInt32 milliseconds;
} RTSQLDateTimeType;



Discussion:

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.


Global Variables

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;


Discusssion:

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_StringNSString
RTSQLType_BooleanNSNumber, CFBooleanRef
RTSQLType_NumberNSNumber, NSString
RTSQLType_FloatNumberNSNumber, NSString
RTSQLType_BigIntNSNumber, NSString
RTSQLType_DecimalNSDecimalNumber, NSNumber, NSString
RTSQLType_DateNSCalendarDate, RTSQLDateTimeType, NSString (YYYY/MM/DD)
RTSQLType_TimeNSString (HI:MM:SS), RTSQLDateTimeType, NSCalendarDate (with the day as 2001/01/01)
RTSQLTime_DateTimeNSCalendarDate, RTSQLDateTimeType, NSString (YYYY/MM/DD HI:MM:SS)
RTSQLType_BlobNSData
RTSQLType_TextBlobNSString
RTSQLType_Unknownnil


Exceptions

In addition to the exceptions listed below, the MacSQL Framework can also throw Foundation exceptions such as NSInvalidArgumentException and NSInternalInconsistencyException.



NSString *RTQueryFailedException;


Discusssion:

Name of exception raised when a query fails.


NSString *RTFeatureNotImplementedException;


Discusssion:

Name of exception raised when a requested action is not implemented (either the plugin or remote server does not support the operation).


NSString *RTInvalidPluginNameException;


Discusssion:

Name of exception raised when a connection is asked to be open to a invalid plugin.


NSString *RTFailedToLoadPluginException;


Discusssion:

Name of exception raised when a plugin fails to load.


NSString *RTFailedToCreateSessionException;


Discusssion:

Name of exception raised when a session fails to open.


NSString *RTPluginNotLoadedException;


Discusssion:

Name of exception raised when a message is sent to a plugin that is not yet loaded.


NSString *RTIllegalDataTypeException;


Discusssion:

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;


Discusssion:

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;


Discusssion:

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.


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