Moodle  2.2.1
http://www.collinsharper.com
sql_generator Class Reference
Inheritance diagram for sql_generator:

Public Member Functions

 __construct ($mdb, $temptables=null)
 dispose ()
 getEndedStatements ($input)
 table_exists ($table)
 getCreateStructureSQL ($xmldb_structure)
 getTableName (xmldb_table $xmldb_table, $quoted=true)
 getCreateTableSQL ($xmldb_table)
 getCreateIndexSQL ($xmldb_table, $xmldb_index)
 getFieldSQL ($xmldb_table, $xmldb_field, $skip_type_clause=NULL, $skip_default_clause=NULL, $skip_notnull_clause=NULL, $specify_nulls_clause=NULL, $specify_field_name=true)
 getKeySQL ($xmldb_table, $xmldb_key)
 getDefaultValue ($xmldb_field)
 getDefaultClause ($xmldb_field)
 getRenameTableSQL ($xmldb_table, $newname)
 getDropTableSQL ($xmldb_table)
 getAddFieldSQL ($xmldb_table, $xmldb_field, $skip_type_clause=NULL, $skip_default_clause=NULL, $skip_notnull_clause=NULL)
 getDropFieldSQL ($xmldb_table, $xmldb_field)
 getAlterFieldSQL ($xmldb_table, $xmldb_field, $skip_type_clause=NULL, $skip_default_clause=NULL, $skip_notnull_clause=NULL)
 getModifyDefaultSQL ($xmldb_table, $xmldb_field)
 getRenameFieldSQL ($xmldb_table, $xmldb_field, $newname)
 getAddKeySQL ($xmldb_table, $xmldb_key)
 getDropKeySQL ($xmldb_table, $xmldb_key)
 getRenameKeySQL ($xmldb_table, $xmldb_key, $newname)
 getAddIndexSQL ($xmldb_table, $xmldb_index)
 getDropIndexSQL ($xmldb_table, $xmldb_index)
 getRenameIndexSQL ($xmldb_table, $xmldb_index, $newname)
 getNameForObject ($tablename, $fields, $suffix='')
 getEncQuoted ($input)
 getExecuteInsertSQL ($statement)
 getConcatSQL ($elements)
 getSequenceFromDB ($xmldb_table)
 isNameInUse ($object_name, $type, $table_name)
 getResetSequenceSQL ($tablename)
 ALL THESE FUNCTION MUST BE CUSTOMISED BY ALL THE XMLDGenerator classes.
 getCreateTempTableSQL ($xmldb_table)
 getDropTempTableSQL ($xmldb_table)
 getTypeSQL ($xmldb_type, $xmldb_length=null, $xmldb_decimals=null)
 getRenameFieldExtraSQL ($xmldb_table, $xmldb_field)
 getCreateSequenceSQL ($xmldb_table, $xmldb_field)
 getCommentSQL ($xmldb_table)
 getRenameTableExtraSQL ($xmldb_table, $newname)
 getDropTableExtraSQL ($xmldb_table)
 getDropEnumSQL ($xmldb_table, $xmldb_field)
 getDropDefaultSQL ($xmldb_table, $xmldb_field)
 getCheckConstraintsFromDB ($xmldb_table, $xmldb_field=null)
 getCreateDefaultSQL ($xmldb_table, $xmldb_field)
 addslashes ($s)

Static Public Member Functions

static getReservedWords ()
static getAllReservedWords ()

Data Fields

 $quote_string = '"'
 $statement_end = ';'
 $quote_all = false
 $integer_to_number = false
 $float_to_number = false
 $number_type = 'NUMERIC'
 $unsigned_allowed = true
 $default_for_char = null
 $drop_default_value_required = false
 $drop_default_value = ''
 $default_after_null = true
 $specify_nulls = false
 $primary_key_name = null
 $primary_keys = true
 $unique_keys = false
 $foreign_keys = false
 $drop_primary_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'
 $drop_unique_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'
 $drop_foreign_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'
 $sequence_extra_code = true
 $sequence_name = 'auto_increment'
 $sequence_name_small = false
 $sequence_only = false
 $add_table_comments = true
 $add_after_clause = false
 $prefix_on_names = true
 $names_max_length = 30
 $concat_character = '||'
 $rename_table_sql = 'ALTER TABLE OLDNAME RENAME TO NEWNAME'
 $drop_table_sql = 'DROP TABLE TABLENAME'
 $alter_column_sql = 'ALTER TABLE TABLENAME ALTER COLUMN COLUMNSPECS'
 $alter_column_skip_default = false
 $alter_column_skip_type = false
 $alter_column_skip_notnull = false
 $rename_column_sql = 'ALTER TABLE TABLENAME RENAME COLUMN OLDFIELDNAME TO NEWFIELDNAME'
 $drop_index_sql = 'DROP INDEX INDEXNAME'
 TABLENAME, OLDFIELDNAME and NEWFIELDNAME are dyanmically replaced.
 $rename_index_sql = 'ALTER INDEX OLDINDEXNAME RENAME TO NEWINDEXNAME'
 $rename_key_sql = 'ALTER TABLE TABLENAME CONSTRAINT OLDKEYNAME RENAME TO NEWKEYNAME'
 $prefix
 $reserved_words
 $mdb

Protected Attributes

 $temptables

Detailed Description

Abstract sql generator class, base for all db specific implementations.

Definition at line 38 of file sql_generator.php.


Constructor & Destructor Documentation

__construct ( mdb,
temptables = null 
)

Creates new sql_generator

Parameters:
objectmoodle_database instance

Definition at line 136 of file sql_generator.php.

Here is the call graph for this function:


Member Function Documentation

addslashes ( s)

Reimplemented in oracle_sql_generator, mssql_sql_generator, sqlite_sql_generator, and postgres_sql_generator.

Definition at line 1222 of file sql_generator.php.

Here is the caller graph for this function:

dispose ( )

Release all resources

Definition at line 146 of file sql_generator.php.

getAddFieldSQL ( xmldb_table,
xmldb_field,
skip_type_clause = NULL,
skip_default_clause = NULL,
skip_notnull_clause = NULL 
)

Given one xmldb_table and one xmldb_field, return the SQL statements needed to add the field to the table

Get the quoted name of the table and field

Build the standard alter table add

Add the after clause if necesary

Definition at line 589 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getAddIndexSQL ( xmldb_table,
xmldb_index 
)

Given one xmldb_table and one xmldb_index, return the SQL statements needed to add the index to the table

Just use the CreateIndexSQL function

Definition at line 866 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getAddKeySQL ( xmldb_table,
xmldb_key 
)

Given one xmldb_table and one xmldb_key, return the SQL statements needed to add the key to the table note that undelying indexes will be added as parametrised by $xxxx_keys and $xxxx_index parameters

Just use the CreateKeySQL function

If we aren't creating the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated automatically by the RDBMS) create the underlying (created by us) index (if doesn't exists)

Only if they don't exist

Calculate type of index based on type ok key

If the key is XMLDB_KEY_FOREIGN_UNIQUE, create it as UNIQUE too

Duplicate the key

Return results

Reimplemented in sqlite_sql_generator.

Definition at line 722 of file sql_generator.php.

Here is the call graph for this function:

static getAllReservedWords ( ) [static]

Returns all reserved works in supported databases. Reserved words should be lowercase.

Returns:
array ('word'=>array(databases))

Definition at line 1205 of file sql_generator.php.

Here is the caller graph for this function:

getAlterFieldSQL ( xmldb_table,
xmldb_field,
skip_type_clause = NULL,
skip_default_clause = NULL,
skip_notnull_clause = NULL 
)

Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table

Get the quoted name of the table and field

Build de alter sentence using the alter_column_sql template

Add the after clause if necesary

Build the standard alter table modify

Reimplemented in oracle_sql_generator, mssql_sql_generator, sqlite_sql_generator, and postgres_sql_generator.

Definition at line 634 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getCheckConstraintsFromDB ( xmldb_table,
xmldb_field = null 
) [abstract]

Given one xmldb_table and one optional xmldb_field, return one array with all the check constrainst found for that table (or field). Must exist for each DB supported. (usually invoked from find_check_constraint_name)

TODO: Moodle 2.1 - Drop getCheckConstraintsFromDB

Reimplemented in oracle_sql_generator, mssql_sql_generator, sqlite_sql_generator, postgres_sql_generator, and mysql_sql_generator.

getCommentSQL ( xmldb_table) [abstract]

Returns the code (array of statements) needed to add one comment to the table

Reimplemented in mssql_sql_generator, sqlite_sql_generator, mysql_sql_generator, oracle_sql_generator, and postgres_sql_generator.

Here is the caller graph for this function:

getConcatSQL ( elements)

Given one array of elements, build de proper CONCAT expression, based in the $concat_character setting. If such setting is empty, then MySQL's CONCAT function will be used instead

Replace double quoted elements by single quotes

Now call the standard $DB->sql_concat() DML function

Definition at line 1064 of file sql_generator.php.

Here is the caller graph for this function:

getCreateDefaultSQL ( xmldb_table,
xmldb_field 
) [abstract]

Given one xmldb_table and one xmldb_field, return the SQL statements needed to add its default (usually invoked from getModifyDefaultSQL()

Reimplemented in oracle_sql_generator, mssql_sql_generator, postgres_sql_generator, sqlite_sql_generator, and mysql_sql_generator.

Here is the caller graph for this function:

getCreateIndexSQL ( xmldb_table,
xmldb_index 
)

Given one correct xmldb_index, returns the SQL statements needed to create it (in array)

Definition at line 350 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getCreateSequenceSQL ( xmldb_table,
xmldb_field 
)

Returns the code (array of statements) needed to create one sequence for the xmldb_table and xmldb_field passes

Reimplemented in oracle_sql_generator.

Definition at line 1137 of file sql_generator.php.

Here is the caller graph for this function:

getCreateStructureSQL ( xmldb_structure)

This function will return the SQL code needed to create db tables and statements

Definition at line 190 of file sql_generator.php.

Here is the call graph for this function:

getCreateTableSQL ( xmldb_table)

Given one correct xmldb_table, returns the SQL statements to create it (inside one array)

Table header

Add the fields, separated by commas

Add the keys, separated by commas

If the key is XMLDB_KEY_FOREIGN_UNIQUE, create it as UNIQUE too

Duplicate the key

make sure sequence field is unique

throw error if sequence field does not have unique key defined

Table footer, trim the latest comma

Add the CREATE TABLE to results

Add comments if specified and it exists

Add the COMMENT to results

Add the indexes (each one, one statement)

tables do not exist yet, which means indexed can not exist yet

Also, add the indexes needed from keys, based on configuration (each one, one statement)

If we aren't creating the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated automatically by the RDBMS) create the underlying (created by us) index (if doesn't exists)

Create the interim index

tables do not exist yet, which means indexed can not exist yet

Add the INDEX to the array

Add sequence extra code if needed

Iterate over fields looking for sequences

returns an array of statements needed to create one sequence

Add the SEQUENCE to the array

Reimplemented in mysql_sql_generator.

Definition at line 225 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getCreateTempTableSQL ( xmldb_table) [abstract]

Given one correct xmldb_table, returns the SQL statements to create temporary table (inside one array)

Reimplemented in mysql_sql_generator, mssql_sql_generator, oracle_sql_generator, and postgres_sql_generator.

getDefaultClause ( xmldb_field)

Given one xmldb_field, returns the correct "default clause" for the current configuration

Definition at line 534 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getDefaultValue ( xmldb_field)

Give one xmldb_field, returns the correct "default value" for the current configuration

We force default '' for not null char columns without proper default some day this should be out!

If the DB requires to explicity define some clause to drop one default, do it here never applying defaults to TEXT and BINARY fields

Definition at line 496 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getDropDefaultSQL ( xmldb_table,
xmldb_field 
) [abstract]

Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop its default (usually invoked from getModifyDefaultSQL()

TODO: Moodle 2.1 - Drop getDropDefaultSQL()

Reimplemented in oracle_sql_generator, mssql_sql_generator, sqlite_sql_generator, postgres_sql_generator, and mysql_sql_generator.

Here is the caller graph for this function:

getDropEnumSQL ( xmldb_table,
xmldb_field 
) [abstract]

Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop its enum (usually invoked from getModifyEnumSQL()

TODO: Moodle 2.1 - Drop getDropEnumSQL()

Reimplemented in oracle_sql_generator, mssql_sql_generator, postgres_sql_generator, sqlite_sql_generator, and mysql_sql_generator.

getDropFieldSQL ( xmldb_table,
xmldb_field 
)

Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop the field from the table

Get the quoted name of the table and field

Build the standard alter table drop

Reimplemented in sqlite_sql_generator, and mssql_sql_generator.

Definition at line 617 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getDropIndexSQL ( xmldb_table,
xmldb_index 
)

Given one xmldb_table and one xmldb_index, return the SQL statements needed to drop the index from the table

Get the real index name

Replace TABLENAME and INDEXNAME as needed

Reimplemented in sqlite_sql_generator.

Definition at line 875 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getDropKeySQL ( xmldb_table,
xmldb_key 
)

Given one xmldb_table and one xmldb_index, return the SQL statements needed to drop the index from the table

Get the key name (note that this doesn't introspect DB, so could cause some problems sometimes!) TODO: We'll need to overwrite the whole getDropKeySQL() method inside each DB to do the proper queries against the dictionary or require ADOdb to support it or change the find_key_name() method to perform DB introspection directly. But, for now, as we aren't going to enable referential integrity it won't be a problem at all

Only if such type of key generation is enabled

If we have decided to drop the key, let's do it

Replace TABLENAME, CONSTRAINTTYPE and KEYNAME as needed

If we aren't dropping the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated automatically by the RDBMS) drop the underlying (created by us) index (if exists)

Only if they exist

If the key is XMLDB_KEY_FOREIGN_UNIQUE, drop the UNIQUE too

Duplicate the key

Return results

Reimplemented in sqlite_sql_generator.

Definition at line 762 of file sql_generator.php.

Here is the call graph for this function:

getDropTableExtraSQL ( xmldb_table)

Returns the code (array of statements) needed to execute extra statements on table drop

Reimplemented in oracle_sql_generator.

Definition at line 1156 of file sql_generator.php.

Here is the caller graph for this function:

getDropTableSQL ( xmldb_table)

Given one correct xmldb_table and the new name, returns the SQL statements to drop it (inside one array)

call to getDropTableExtraSQL(), override if needed

Definition at line 571 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getDropTempTableSQL ( xmldb_table) [abstract]

Given one correct xmldb_table and the new name, returns the SQL statements to drop it (inside one array)

Reimplemented in mysql_sql_generator, mssql_sql_generator, oracle_sql_generator, and postgres_sql_generator.

getEncQuoted ( input)

Given any string (or one array), enclose it by the proper quotes if it's a reserved word

Always lowercase

if reserved or quote_all or has hyphens, quote it

Definition at line 989 of file sql_generator.php.

Here is the caller graph for this function:

getEndedStatements ( input)

Given one string (or one array), ends it with statement_end

Definition at line 153 of file sql_generator.php.

getExecuteInsertSQL ( statement)

Given one XMLDB Statement, build the needed SQL insert sentences to execute it

Get the list of fields

Get the values of fields

Look if we have some CONCAT value and transform it dynamically

Trim single quotes

Look for data between parenthesis

Convert the comma separated string to an array

Values to be sent to DB must be properly escaped

Back trimmed quotes

Back to the array

Iterate over fields, escaping them if necessary

Build the final SQL sentence and add it to the array of results

Definition at line 1010 of file sql_generator.php.

Here is the call graph for this function:

getFieldSQL ( xmldb_table,
xmldb_field,
skip_type_clause = NULL,
skip_default_clause = NULL,
skip_notnull_clause = NULL,
specify_nulls_clause = NULL,
specify_field_name = true 
)

Given one correct xmldb_field, returns the complete SQL line to create it

First of all, convert integers to numbers if defined

Same for floats

The name

The type and length only if we don't want to skip it

The type and length

The unsigned if supported

Calculate the not null clause

Only if we don't want to skip it

Calculate the default clause

Based on default_after_null, set both clauses properly

The sequence

We only want the field name and sequence name to be printed so, calculate it and return

Definition at line 373 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getKeySQL ( xmldb_table,
xmldb_key 
)

Given one correct xmldb_key, returns its specs

Reimplemented in sqlite_sql_generator.

Definition at line 458 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getModifyDefaultSQL ( xmldb_table,
xmldb_field 
)

Given one xmldb_table and one xmldb_field, return the SQL statements needed to modify the default of the field in the table

Get the quoted name of the table and field

Decide if we are going to create/modify or to drop the default

Reimplemented in mssql_sql_generator.

Definition at line 668 of file sql_generator.php.

Here is the call graph for this function:

getNameForObject ( tablename,
fields,
suffix = '' 
)

Given three strings (table name, list of fields (comma separated) and suffix), create the proper object name quoting it if necessary.

IMPORTANT: This function must be used to CALCULATE NAMES of objects TO BE CREATED, NEVER TO GUESS NAMES of EXISTING objects!!!

Implement one basic cache to avoid object name duplication along all the request life, but never to return cached results We need this because sql statements are created before executing them, hence names doesn't exist "physically" yet in DB, so we need to known which ones have been used

Use standard naming. See http://docs.moodle.org/en/XMLDB_key_and_index_naming

Prepend the prefix

Add the suffix

If the calculated name is in the cache, or if we detect it by introspecting the DB let's modify if

If have free space, we add 2

Else replace the last char by 2

Now iterate until not used name is found, incrementing the counter

Add the name to the cache

Quote it if necessary (reserved words)

Reimplemented in mssql_sql_generator.

Definition at line 918 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getRenameFieldExtraSQL ( xmldb_table,
xmldb_field 
)

Returns the code (array of statements) needed to execute extra statements on field rename

Definition at line 1129 of file sql_generator.php.

Here is the caller graph for this function:

getRenameFieldSQL ( xmldb_table,
xmldb_field,
newname 
)

Given one correct xmldb_field and the new name, returns the SQL statements to rename it (inside one array)

Although this is checked in database_manager::rename_field() - double check that we aren't trying to rename one "id" field. Although it could be implemented (if adding the necessary code to rename sequences, defaults, triggers... and so on under each getRenameFieldExtraSQL() function, it's better to forbid it, mainly because this field is the default PK and in the future, a lot of FKs can be pointing here. So, this field, more or less, must be considered immutable!

Call to getRenameFieldExtraSQL(), override if needed

Reimplemented in sqlite_sql_generator, mysql_sql_generator, and mssql_sql_generator.

Definition at line 690 of file sql_generator.php.

Here is the call graph for this function:

getRenameIndexSQL ( xmldb_table,
xmldb_index,
newname 
)

Given one xmldb_table and one xmldb_index, return the SQL statements needed to rename the index in the table Experimental! Shouldn't be used at all!

Some DB doesn't support index renaming (MySQL) so this can be empty

Get the real index name

Replace TABLENAME and INDEXNAME as needed

Reimplemented in sqlite_sql_generator.

Definition at line 895 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getRenameKeySQL ( xmldb_table,
xmldb_key,
newname 
)

Given one xmldb_table and one xmldb_key, return the SQL statements needed to rename the key in the table Experimental! Shouldn't be used at all!

Get the real key name

Check we are really generating this type of keys

We aren't generating this type of keys, delegate to child indexes

Arrived here so we are working with keys, lets rename them Replace TABLENAME and KEYNAME as needed

Some DB doesn't support key renaming so this can be empty

Reimplemented in sqlite_sql_generator.

Definition at line 831 of file sql_generator.php.

Here is the call graph for this function:

getRenameTableExtraSQL ( xmldb_table,
newname 
)

Returns the code (array of statements) needed to execute extra statements on table rename

Reimplemented in oracle_sql_generator, mssql_sql_generator, and postgres_sql_generator.

Definition at line 1149 of file sql_generator.php.

Here is the caller graph for this function:

getRenameTableSQL ( xmldb_table,
newname 
)

Given one correct xmldb_table and the new name, returns the SQL statements to rename it (inside one array)

Call to getRenameTableExtraSQL() override if needed

Definition at line 549 of file sql_generator.php.

Here is the call graph for this function:

static getReservedWords ( ) [static]

Returns an array of reserved words (lowercase) for this DB You MUST provide the real list for each DB inside every XMLDB class

Returns:
array of reserved words

Reimplemented in oracle_sql_generator, mssql_sql_generator, postgres_sql_generator, sqlite_sql_generator, and mysql_sql_generator.

Definition at line 1196 of file sql_generator.php.

Here is the caller graph for this function:

getResetSequenceSQL ( tablename) [abstract]

ALL THESE FUNCTION MUST BE CUSTOMISED BY ALL THE XMLDGenerator classes.

Reset a sequence to the id field of a table.

Parameters:
string$tablename of table
Returns:
success

Reimplemented in mysql_sql_generator, mssql_sql_generator, sqlite_sql_generator, oracle_sql_generator, and postgres_sql_generator.

getSequenceFromDB ( xmldb_table)

Returns the name (string) of the sequence used in the table for the autonumeric pk Only some DB have this implemented

Reimplemented in oracle_sql_generator, and postgres_sql_generator.

Definition at line 1083 of file sql_generator.php.

getTableName ( xmldb_table xmldb_table,
quoted = true 
)

Given one xmldb_table, returns it's correct name, depending of all the parametrization

Parameters:
xmldb_tabletable whose name we want
booleanto specify if the name must be quoted (if reserved word, only!)
Returns:
string the correct name of the table

Get the name

Apply quotes optionally

Reimplemented in mssql_sql_generator, and oracle_sql_generator.

Definition at line 209 of file sql_generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getTypeSQL ( xmldb_type,
xmldb_length = null,
xmldb_decimals = null 
) [abstract]

Given one XMLDB Type, length and decimals, returns the DB proper SQL type

Reimplemented in mysql_sql_generator, mssql_sql_generator, oracle_sql_generator, sqlite_sql_generator, and postgres_sql_generator.

Here is the caller graph for this function:

isNameInUse ( object_name,
type,
table_name 
)

Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg) return if such name is currently in use (true) or no (false) (MySQL requires the whole xmldb_table object to be specified, so we add it always) (invoked from getNameForObject() Only some DB have this implemented

Reimplemented in oracle_sql_generator, mssql_sql_generator, postgres_sql_generator, sqlite_sql_generator, and mysql_sql_generator.

Definition at line 1094 of file sql_generator.php.

Here is the caller graph for this function:

table_exists ( table)

Given one xmldb_table, check if it exists in DB (true/false)

Parameters:
mixedthe table to be searched (string name or xmldb_table instance)
Returns:
boolean true/false

Calculate the name of the table

get all tables in moodle database

Definition at line 172 of file sql_generator.php.


Field Documentation

$add_after_clause = false

Reimplemented in mysql_sql_generator.

Definition at line 89 of file sql_generator.php.

$add_table_comments = true

Reimplemented in mssql_sql_generator.

Definition at line 87 of file sql_generator.php.

$alter_column_skip_default = false

Definition at line 106 of file sql_generator.php.

$alter_column_skip_notnull = false

Definition at line 110 of file sql_generator.php.

$alter_column_skip_type = false

Definition at line 108 of file sql_generator.php.

$alter_column_sql = 'ALTER TABLE TABLENAME ALTER COLUMN COLUMNSPECS'

Reimplemented in mysql_sql_generator, and oracle_sql_generator.

Definition at line 104 of file sql_generator.php.

$concat_character = '||'

Reimplemented in mysql_sql_generator, and mssql_sql_generator.

Definition at line 95 of file sql_generator.php.

$default_after_null = true

Reimplemented in oracle_sql_generator.

Definition at line 62 of file sql_generator.php.

$default_for_char = null
$drop_default_value = ''

Reimplemented in oracle_sql_generator, mysql_sql_generator, and sqlite_sql_generator.

Definition at line 60 of file sql_generator.php.

$drop_default_value_required = false

Reimplemented in oracle_sql_generator, mysql_sql_generator, and sqlite_sql_generator.

Definition at line 59 of file sql_generator.php.

$drop_foreign_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'

Reimplemented in mysql_sql_generator, and sqlite_sql_generator.

Definition at line 79 of file sql_generator.php.

$drop_index_sql = 'DROP INDEX INDEXNAME'

TABLENAME, OLDFIELDNAME and NEWFIELDNAME are dyanmically replaced.

Reimplemented in mysql_sql_generator, mssql_sql_generator, and sqlite_sql_generator.

Definition at line 115 of file sql_generator.php.

$drop_primary_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'

Reimplemented in mysql_sql_generator, and sqlite_sql_generator.

Definition at line 73 of file sql_generator.php.

$drop_table_sql = 'DROP TABLE TABLENAME'

Definition at line 101 of file sql_generator.php.

$drop_unique_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'

Reimplemented in mysql_sql_generator, and sqlite_sql_generator.

Definition at line 76 of file sql_generator.php.

$float_to_number = false

Definition at line 52 of file sql_generator.php.

$foreign_keys = false

Definition at line 71 of file sql_generator.php.

$integer_to_number = false

Definition at line 51 of file sql_generator.php.

$mdb

Definition at line 128 of file sql_generator.php.

$names_max_length = 30

Definition at line 93 of file sql_generator.php.

$number_type = 'NUMERIC'

Reimplemented in oracle_sql_generator, mssql_sql_generator, and postgres_sql_generator.

Definition at line 54 of file sql_generator.php.

Definition at line 124 of file sql_generator.php.

$prefix_on_names = true

Definition at line 91 of file sql_generator.php.

$primary_key_name = null

Reimplemented in mysql_sql_generator.

Definition at line 67 of file sql_generator.php.

$primary_keys = true

Definition at line 69 of file sql_generator.php.

$quote_all = false

Definition at line 49 of file sql_generator.php.

$quote_string = '"'

Please, avoid editing this defaults in this base class! It could change the behaviour of the rest of generators that, by default, inherit this configuration. To change any of them, do it in extended classes instead.

Reimplemented in mysql_sql_generator.

Definition at line 45 of file sql_generator.php.

$rename_column_sql = 'ALTER TABLE TABLENAME RENAME COLUMN OLDFIELDNAME TO NEWFIELDNAME'

Reimplemented in mssql_sql_generator.

Definition at line 112 of file sql_generator.php.

$rename_index_sql = 'ALTER INDEX OLDINDEXNAME RENAME TO NEWINDEXNAME'
$rename_key_sql = 'ALTER TABLE TABLENAME CONSTRAINT OLDKEYNAME RENAME TO NEWKEYNAME'
$rename_table_sql = 'ALTER TABLE OLDNAME RENAME TO NEWNAME'

Reimplemented in mssql_sql_generator.

Definition at line 98 of file sql_generator.php.

$reserved_words

Definition at line 126 of file sql_generator.php.

$sequence_extra_code = true
$sequence_name = 'auto_increment'
$sequence_name_small = false

Reimplemented in postgres_sql_generator.

Definition at line 84 of file sql_generator.php.

$sequence_only = false

Reimplemented in mssql_sql_generator, sqlite_sql_generator, and postgres_sql_generator.

Definition at line 85 of file sql_generator.php.

$specify_nulls = false

Reimplemented in mssql_sql_generator.

Definition at line 64 of file sql_generator.php.

$statement_end = ';'

Reimplemented in mssql_sql_generator, and oracle_sql_generator.

Definition at line 47 of file sql_generator.php.

$temptables [protected]

Definition at line 130 of file sql_generator.php.

$unique_keys = false

Definition at line 70 of file sql_generator.php.

$unsigned_allowed = true

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations