objective-c-sql-query-builder
Public Member Functions | Protected Attributes
ZIMSqlCreateTableStatement Class Reference

#import <ZIMSqlCreateTableStatement.h>

Inheritance diagram for ZIMSqlCreateTableStatement:
<ZIMSqlStatement> <ZIMSqlDataDefinitionCommand>

List of all members.

Public Member Functions

(id) - initWithXmlSchema:error:
(id) - init
(void) - table:
(void) - table:temporary:
(void) - column:type:
(void) - column:type:defaultValue:
(void) - column:type:primaryKey:
(void) - column:type:unique:
(void) - primaryKey:
(void) - unique:
(NSString *) - statement
(void) - parser:didStartElement:namespaceURI:qualifiedName:attributes: [implementation]
(void) - parser:didEndElement:namespaceURI:qualifiedName: [implementation]
(void) - parser:parseErrorOccurred: [implementation]

Protected Attributes

NSString_table
BOOL _temporary
NSMutableDictionary * _columnDictionary
NSMutableArray * _columnArray
NSString_primaryKey
NSString_unique
NSMutableArray * _stack
NSUInteger _counter
NSError * _error

Detailed Description

Discussion:
This class represents an SQL create table statement.
Updated:
2012-03-18
See also:
http://www.sqlite.org/lang_createtable.html

Member Function Documentation

- (void) column: (NSString *)  column
type: (NSString *)  type 
Signature:
column:type:
Discussion:
This method will create a column with the specified parameters.
Parameters:
columnThe column to be created.
typeThe datatype of the column.
Updated:
2011-10-30
- (void) column: (NSString *)  column
type: (NSString *)  type
defaultValue: (NSString *)  value 
Signature:
column:type:defaultValue:
Discussion:
This method will create a column with the specified parameters.
Parameters:
columnThe column to be created.
typeThe datatype of the column.
valueThe default value to be used when no data is provided.
Updated:
2011-10-30
- (void) column: (NSString *)  column
type: (NSString *)  type
primaryKey: (BOOL)  primaryKey 
Signature:
column:type:primaryKey:
Discussion:
This method will create a column with the specified parameters.
Parameters:
columnThe column to be created.
typeThe datatype of the column.
primaryKeyThis marks the specified column as the primary key.
Updated:
2011-10-30
- (void) column: (NSString *)  column
type: (NSString *)  type
unique: (BOOL)  unique 
Signature:
column:type:unique:
Discussion:
This method will create a column with the specified datatype. It also provides the option to ensure that all values in the column are distinct.
Parameters:
columnThe column to be created.
typeThe datatype of the column.
uniqueThis constrains the column to only unique values.
Updated:
2011-10-30
- (instancetype) init
Signature:
init
Discussion:
This method initializes the class.
Returns:
An instance of this class.
Updated:
2012-03-20
- (instancetype) initWithXmlSchema: (NSData *)  xml
error: (NSError **)  error 
Signature:
initWithXmlSchema:error:
Discussion:
This method initializes the class via an XML file following Ziminji's "XML to DDL" schema.
Parameters:
xmlThe UTF-8 encoded string of XML.
errorUsed when an error occurs while processing the XML data. May be NULL.
Returns:
An instance of this class.
Updated:
2011-10-19
See also:
http://db.apache.org/ddlutils/
http://db.apache.org/ddlutils/schema/
- (void) parser: (NSXMLParser *)  parser
didEndElement: (NSString *)  element
namespaceURI: (NSString *)  namespaceURI
qualifiedName: (NSString *)  qualifiedName 
[implementation]
- (void) parser: (NSXMLParser *)  parser
didStartElement: (NSString *)  element
namespaceURI: (NSString *)  namespaceURI
qualifiedName: (NSString *)  qualifiedName
attributes: (NSDictionary *)  attributes 
[implementation]
- (void) parser: (NSXMLParser *)  parser
parseErrorOccurred: (NSError *)  error 
[implementation]
- (void) primaryKey: (NSArray *)  columns
Signature:
primaryKey:
Discussion:
This method will set the specified columns to be the (composite) primary key.
Parameters:
columnsThe columns to be set as the (composite) primary key.
Updated:
2011-11-01
- (NSString *) statement
Signature:
statement
Discussion:
This method will return the SQL statement.
Returns:
The SQL statement that was constructed.
Updated:
2011-10-19

Reimplemented from <ZIMSqlStatement>.

- (void) table: (NSString *)  table
Signature:
table:
Discussion:
This method sets the name for the table in the SQL statement.
Parameters:
tableThe table's name.
Updated:
2011-06-26
- (void) table: (NSString *)  table
temporary: (BOOL)  temporary 
Signature:
table:temporary:
Discussion:
This method sets the name for the table in the SQL statement and whether it is temporary or not.
Parameters:
tableThe table's name.
temporaryThis establishes whether the table will be temporary.
Updated:
2011-10-30
- (void) unique: (NSArray *)  columns
Signature:
unique:
Discussion:
This method will apply a unique constraint across the specified columns.
Parameters:
columnsThe columns to be constrained.
Updated:
2011-11-01

Member Data Documentation

- (NSMutableArray*) _columnArray [protected]
- (NSMutableDictionary*) _columnDictionary [protected]
- (NSUInteger) _counter [protected]
- (NSError*) _error [protected]
- (NSString*) _primaryKey [protected]
- (NSMutableArray*) _stack [protected]
- (NSString*) _table [protected]
- (BOOL) _temporary [protected]
- (NSString*) _unique [protected]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Properties Defines