-
Notifications
You must be signed in to change notification settings - Fork 0
CI_DB_sqlite3_forge
SQLite3 Forge Class
- Class name: CI_DB_sqlite3_forge
- Namespace:
- Parent class: CI_DB_forge
protected boolean $_unsigned = TRUE
UNSIGNED support
- Visibility: protected
protected string $_null = ''
NULL value representation in CREATE/ALTER TABLE statements
- Visibility: protected
protected object $db
Database object
- Visibility: protected
public array $fields = array()
Fields data
- Visibility: public
public array $keys = array()
Keys data
- Visibility: public
public array $primary_keys = array()
Primary Keys data
- Visibility: public
public string $db_char_set = ''
Database character set
- Visibility: public
protected string $_create_database = 'CREATE DATABASE %s'
CREATE DATABASE statement
- Visibility: protected
protected string $_drop_database = 'DROP DATABASE %s'
DROP DATABASE statement
- Visibility: protected
protected string $_create_table = "%s %s (%s\n)"
CREATE TABLE statement
- Visibility: protected
protected string $_create_table_if = 'CREATE TABLE IF NOT EXISTS'
CREATE TABLE IF statement
- Visibility: protected
protected boolean $_create_table_keys = FALSE
CREATE TABLE keys flag
Whether table keys are created from within the CREATE TABLE statement.
- Visibility: protected
protected string $_drop_table_if = 'DROP TABLE IF EXISTS'
DROP TABLE IF EXISTS statement
- Visibility: protected
protected string $_rename_table = 'ALTER TABLE %s RENAME TO %s;'
RENAME TABLE statement
- Visibility: protected
protected string $_default = ' DEFAULT '
DEFAULT value representation in CREATE/ALTER TABLE statements
- Visibility: protected
void CI_DB_forge::__construct($db)
Class constructor
- Visibility: public
- This method is defined by CI_DB_forge
- $db mixed
boolean CI_DB_forge::create_database(string $db_name)
Create database
- Visibility: public
- This method is defined by CI_DB_forge
- $db_name string
boolean CI_DB_forge::drop_database(string $db_name)
Drop database
- Visibility: public
- This method is defined by CI_DB_forge
- $db_name string
string|array<mixed,string> CI_DB_forge::_alter_table(string $alter_type, string $table, mixed $field)
ALTER TABLE
- Visibility: protected
- This method is defined by CI_DB_forge
- $alter_type string - <p>ALTER type</p>
- $table string - <p>Table name</p>
- $field mixed - <p>Column definition</p>
string CI_DB_forge::_process_column(array $field)
Process column
- Visibility: protected
- This method is defined by CI_DB_forge
- $field array
void CI_DB_forge::_attr_type($attributes)
Field attribute TYPE
Performs a data type mapping between different databases.
- Visibility: protected
- This method is defined by CI_DB_forge
- $attributes mixed
void CI_DB_forge::_attr_auto_increment($attributes, $field)
Field attribute AUTO_INCREMENT
- Visibility: protected
- This method is defined by CI_DB_forge
- $attributes mixed
- $field mixed
\CI_DB_forge CI_DB_forge::add_key(string $key, boolean $primary)
Add Key
- Visibility: public
- This method is defined by CI_DB_forge
- $key string
- $primary boolean
\CI_DB_forge CI_DB_forge::add_field(array $field)
Add Field
- Visibility: public
- This method is defined by CI_DB_forge
- $field array
boolean CI_DB_forge::create_table(string $table, boolean $if_not_exists, array $attributes)
Create Table
- Visibility: public
- This method is defined by CI_DB_forge
- $table string - <p>Table name</p>
- $if_not_exists boolean - <p>Whether to add IF NOT EXISTS condition</p>
- $attributes array - <p>Associative array of table attributes</p>
mixed CI_DB_forge::_create_table(string $table, boolean $if_not_exists, array $attributes)
Create Table
- Visibility: protected
- This method is defined by CI_DB_forge
- $table string - <p>Table name</p>
- $if_not_exists boolean - <p>Whether to add 'IF NOT EXISTS' condition</p>
- $attributes array - <p>Associative array of table attributes</p>
string CI_DB_forge::_create_table_attr(array $attributes)
CREATE TABLE attributes
- Visibility: protected
- This method is defined by CI_DB_forge
- $attributes array - <p>Associative array of table attributes</p>
boolean CI_DB_forge::drop_table(string $table_name, boolean $if_exists)
Drop Table
- Visibility: public
- This method is defined by CI_DB_forge
- $table_name string - <p>Table name</p>
- $if_exists boolean - <p>Whether to add an IF EXISTS condition</p>
string CI_DB_forge::_drop_table(string $table, boolean $if_exists)
Drop Table
Generates a platform-specific DROP TABLE string
- Visibility: protected
- This method is defined by CI_DB_forge
- $table string - <p>Table name</p>
- $if_exists boolean - <p>Whether to add an IF EXISTS condition</p>
boolean CI_DB_forge::rename_table(string $table_name, string $new_table_name)
Rename Table
- Visibility: public
- This method is defined by CI_DB_forge
- $table_name string - <p>Old table name</p>
- $new_table_name string - <p>New table name</p>
boolean CI_DB_forge::add_column(string $table, array $field, string $_after)
Column Add
- Visibility: public
- This method is defined by CI_DB_forge
- $table string - <p>Table name</p>
- $field array - <p>Column definition</p>
- $_after string - <p>Column for AFTER clause (deprecated)</p>
boolean CI_DB_forge::drop_column(string $table, string $column_name)
Column Drop
- Visibility: public
- This method is defined by CI_DB_forge
- $table string - <p>Table name</p>
- $column_name string - <p>Column name</p>
boolean CI_DB_forge::modify_column(string $table, string $field)
Column Modify
- Visibility: public
- This method is defined by CI_DB_forge
- $table string - <p>Table name</p>
- $field string - <p>Column definition</p>
array CI_DB_forge::_process_fields(boolean $create_table)
Process fields
- Visibility: protected
- This method is defined by CI_DB_forge
- $create_table boolean
void CI_DB_forge::_attr_unsigned($attributes, $field)
Field attribute UNSIGNED
Depending on the _unsigned property value:
- TRUE will always set $field['unsigned'] to 'UNSIGNED'
- FALSE will always set $field['unsigned'] to ''
- array(TYPE) will set $field['unsigned'] to 'UNSIGNED', if $attributes['TYPE'] is found in the array
- array(TYPE => UTYPE) will change $field['type'], from TYPE to UTYPE in case of a match
- Visibility: protected
- This method is defined by CI_DB_forge
- $attributes mixed
- $field mixed
void CI_DB_forge::_attr_default($attributes, $field)
Field attribute DEFAULT
- Visibility: protected
- This method is defined by CI_DB_forge
- $attributes mixed
- $field mixed
void CI_DB_forge::_attr_unique($attributes, $field)
Field attribute UNIQUE
- Visibility: protected
- This method is defined by CI_DB_forge
- $attributes mixed
- $field mixed
string CI_DB_forge::_process_primary_keys(string $table)
Process primary keys
- Visibility: protected
- This method is defined by CI_DB_forge
- $table string - <p>Table name</p>
string CI_DB_forge::_process_indexes(string $table)
Process indexes
- Visibility: protected
- This method is defined by CI_DB_forge
- $table string
void CI_DB_forge::_reset()
Reset
Resets table creation vars
- Visibility: protected
- This method is defined by CI_DB_forge