code
stringlengths
17
296k
docstring
stringlengths
30
30.3k
func_name
stringlengths
1
89
language
stringclasses
1 value
repo
stringlengths
7
63
path
stringlengths
7
153
url
stringlengths
51
209
license
stringclasses
4 values
public function field_data() { $retval = array(); $field_data = $this->result_id->fetch_fields(); for ($i = 0, $c = count($field_data); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $field_data[$i]->name; $retval[$i]->type = static::_get_field_type($field_data[$i]->type); $retval[$i]->max_length = $field_data[$i]->max_length; $retval[$i]->primary_key = (int) ($field_data[$i]->flags & MYSQLI_PRI_KEY_FLAG); $retval[$i]->default = $field_data[$i]->def; } return $retval; }
Field data Generates an array of objects containing field meta-data @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/mysqli/mysqli_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/mysqli/mysqli_result.php
MIT
private static function _get_field_type($flags) { static $map; isset($map) OR $map = array( MYSQLI_TYPE_DECIMAL => 'decimal', MYSQLI_TYPE_BIT => 'bit', MYSQLI_TYPE_TINY => 'tinyint', MYSQLI_TYPE_SHORT => 'smallint', MYSQLI_TYPE_INT24 => 'mediumint', MYSQLI_TYPE_LONG => 'int', MYSQLI_TYPE_LONGLONG => 'bigint', MYSQLI_TYPE_FLOAT => 'float', MYSQLI_TYPE_DOUBLE => 'double', MYSQLI_TYPE_TIMESTAMP => 'timestamp', MYSQLI_TYPE_DATE => 'date', MYSQLI_TYPE_TIME => 'time', MYSQLI_TYPE_DATETIME => 'datetime', MYSQLI_TYPE_YEAR => 'year', MYSQLI_TYPE_NEWDATE => 'date', MYSQLI_TYPE_INTERVAL => 'interval', MYSQLI_TYPE_ENUM => 'enum', MYSQLI_TYPE_SET => 'set', MYSQLI_TYPE_TINY_BLOB => 'tinyblob', MYSQLI_TYPE_MEDIUM_BLOB => 'mediumblob', MYSQLI_TYPE_BLOB => 'blob', MYSQLI_TYPE_LONG_BLOB => 'longblob', MYSQLI_TYPE_STRING => 'char', MYSQLI_TYPE_VAR_STRING => 'varchar', MYSQLI_TYPE_GEOMETRY => 'geometry' ); foreach ($map as $flag => $name) { if ($flags & $flag) { return $name; } } return $flags; }
Get field type Extracts field type info from the bitflags returned by mysqli_result::fetch_fields() @used-by CI_DB_mysqli_result::field_data() @param int $flags @return string
_get_field_type
php
ronknight/InventorySystem
system/database/drivers/mysqli/mysqli_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/mysqli/mysqli_result.php
MIT
public function data_seek($n = 0) { return $this->result_id->data_seek($n); }
Data Seek Moves the internal pointer to the desired offset. We call this internally before fetching results to make sure the result set starts at zero. @param int $n @return bool
data_seek
php
ronknight/InventorySystem
system/database/drivers/mysqli/mysqli_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/mysqli/mysqli_result.php
MIT
protected function _fetch_assoc() { return $this->result_id->fetch_assoc(); }
Result - associative array Returns the result set as an array @return array
_fetch_assoc
php
ronknight/InventorySystem
system/database/drivers/mysqli/mysqli_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/mysqli/mysqli_result.php
MIT
protected function _fetch_object($class_name = 'stdClass') { return $this->result_id->fetch_object($class_name); }
Result - object Returns the result set as an object @param string $class_name @return object
_fetch_object
php
ronknight/InventorySystem
system/database/drivers/mysqli/mysqli_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/mysqli/mysqli_result.php
MIT
protected function _escape_str($str) { // Escape the string $str = $this->conn_id->quote($str); // If there are duplicated quotes, trim them away return ($str[0] === "'") ? substr($str, 1, -1) : $str; }
Platform-dependent string escape @param string @return string
_escape_str
php
ronknight/InventorySystem
system/database/drivers/pdo/pdo_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/pdo_driver.php
MIT
protected function _field_data($table) { return 'SELECT TOP 1 * FROM '.$this->protect_identifiers($table); }
Field data query Generates a platform-specific query so that the column data can be retrieved @param string $table @return string
_field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/pdo_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/pdo_driver.php
MIT
protected function _truncate($table) { return 'TRUNCATE TABLE '.$table; }
Truncate statement Generates a platform-specific truncate string from the supplied data If the database does not support the TRUNCATE statement, then this method maps to 'DELETE FROM table' @param string $table @return string
_truncate
php
ronknight/InventorySystem
system/database/drivers/pdo/pdo_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/pdo_driver.php
MIT
public function num_fields() { return $this->result_id->columnCount(); }
Number of fields in the result set @return int
num_fields
php
ronknight/InventorySystem
system/database/drivers/pdo/pdo_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/pdo_result.php
MIT
public function list_fields() { $field_names = array(); for ($i = 0, $c = $this->num_fields(); $i < $c; $i++) { // Might trigger an E_WARNING due to not all subdrivers // supporting getColumnMeta() $field_names[$i] = @$this->result_id->getColumnMeta($i); $field_names[$i] = $field_names[$i]['name']; } return $field_names; }
Fetch Field Names Generates an array of column names @return bool
list_fields
php
ronknight/InventorySystem
system/database/drivers/pdo/pdo_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/pdo_result.php
MIT
public function field_data() { try { $retval = array(); for ($i = 0, $c = $this->num_fields(); $i < $c; $i++) { $field = $this->result_id->getColumnMeta($i); $retval[$i] = new stdClass(); $retval[$i]->name = $field['name']; $retval[$i]->type = $field['native_type']; $retval[$i]->max_length = ($field['len'] > 0) ? $field['len'] : NULL; $retval[$i]->primary_key = (int) ( ! empty($field['flags']) && in_array('primary_key', $field['flags'], TRUE)); } return $retval; } catch (Exception $e) { if ($this->db->db_debug) { return $this->db->display_error('db_unsupported_feature'); } return FALSE; } }
Field data Generates an array of objects containing field meta-data @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/pdo_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/pdo_result.php
MIT
protected function _fetch_assoc() { return $this->result_id->fetch(PDO::FETCH_ASSOC); }
Result - associative array Returns the result set as an array @return array
_fetch_assoc
php
ronknight/InventorySystem
system/database/drivers/pdo/pdo_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/pdo_result.php
MIT
protected function _fetch_object($class_name = 'stdClass') { return $this->result_id->fetchObject($class_name); }
Result - object Returns the result set as an object @param string $class_name @return object
_fetch_object
php
ronknight/InventorySystem
system/database/drivers/pdo/pdo_result.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/pdo_result.php
MIT
protected function _attr_type(&$attributes) { // Reset field lengths for data types that don't support it if (isset($attributes['CONSTRAINT']) && stripos($attributes['TYPE'], 'int') !== FALSE) { $attributes['CONSTRAINT'] = NULL; } switch (strtoupper($attributes['TYPE'])) { case 'TINYINT': $attributes['TYPE'] = 'SMALLINT'; $attributes['UNSIGNED'] = FALSE; return; case 'MEDIUMINT': $attributes['TYPE'] = 'INTEGER'; $attributes['UNSIGNED'] = FALSE; return; default: return; } }
Field attribute TYPE Performs a data type mapping between different databases. @param array &$attributes @return void
_attr_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
MIT
protected function _attr_auto_increment(&$attributes, &$field) { if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) { $field['type'] = ($field['type'] === 'NUMERIC') ? 'BIGSERIAL' : 'SERIAL'; } }
Field attribute AUTO_INCREMENT @param array &$attributes @param array &$field @return void
_attr_auto_increment
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = 'sqlite:'; if (empty($this->database) && empty($this->hostname)) { $this->database = ':memory:'; } $this->database = empty($this->database) ? $this->hostname : $this->database; } }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT "NAME" FROM "SQLITE_MASTER" WHERE "TYPE" = \'table\''; if ($prefix_limit === TRUE && $this->dbprefix !== '') { return $sql.' AND "NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
MIT
public function field_data($table) { if (($query = $this->query('PRAGMA TABLE_INFO('.$this->protect_identifiers($table, TRUE, NULL, FALSE).')')) === FALSE) { return FALSE; } $query = $query->result_array(); if (empty($query)) { return FALSE; } $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]['name']; $retval[$i]->type = $query[$i]['type']; $retval[$i]->max_length = NULL; $retval[$i]->default = $query[$i]['dflt_value']; $retval[$i]->primary_key = isset($query[$i]['pk']) ? (int) $query[$i]['pk'] : 0; } return $retval; }
Returns an object with field data @param string $table @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
MIT
protected function _truncate($table) { return 'DELETE FROM '.$table; }
Truncate statement Generates a platform-specific truncate string from the supplied data If the database does not support the TRUNCATE statement, then this method maps to 'DELETE FROM table' @param string $table @return string
_truncate
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = 'odbc:'; // Pre-defined DSN if (empty($this->hostname) && empty($this->HOSTNAME) && empty($this->port) && empty($this->PORT)) { if (isset($this->DSN)) { $this->dsn .= 'DSN='.$this->DSN; } elseif ( ! empty($this->database)) { $this->dsn .= 'DSN='.$this->database; } return; } // If the DSN is not pre-configured - try to build an IBM DB2 connection string $this->dsn .= 'DRIVER='.(isset($this->DRIVER) ? '{'.$this->DRIVER.'}' : '{IBM DB2 ODBC DRIVER}').';'; if (isset($this->DATABASE)) { $this->dsn .= 'DATABASE='.$this->DATABASE.';'; } elseif ( ! empty($this->database)) { $this->dsn .= 'DATABASE='.$this->database.';'; } if (isset($this->HOSTNAME)) { $this->dsn .= 'HOSTNAME='.$this->HOSTNAME.';'; } else { $this->dsn .= 'HOSTNAME='.(empty($this->hostname) ? '127.0.0.1;' : $this->hostname.';'); }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
MIT
protected function _escape_str($str) { $this->display_error('db_unsupported_feature'); }
Platform-dependent string escape @param string @return string
_escape_str
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
MIT
public function is_write_type($sql) { if (preg_match('#^(INSERT|UPDATE).*RETURNING\s.+(\,\s?.+)*$#is', $sql)) { return FALSE; } return parent::is_write_type($sql); }
Determines if a query is a "write" type. @param string An SQL query string @return bool
is_write_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = '".$this->schema."'"; if ($prefix_limit !== FALSE && $this->dbprefix !== '') { return $sql." AND table_name LIKE '".$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
MIT
protected function _list_columns($table = '') { return 'SELECT column_name FROM information_schema.columns WHERE table_name = '.$this->escape($table); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = 'pgsql:host='.(empty($this->hostname) ? '127.0.0.1' : $this->hostname); empty($this->port) OR $this->dsn .= ';port='.$this->port; empty($this->database) OR $this->dsn .= ';dbname='.$this->database; if ( ! empty($this->username)) { $this->dsn .= ';username='.$this->username; empty($this->password) OR $this->dsn .= ';password='.$this->password; } }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
MIT
public function is_write_type($sql) { if (preg_match('#^(INSERT|UPDATE).*RETURNING\s.+(\,\s?.+)*$#is', $sql)) { return FALSE; } return parent::is_write_type($sql); }
Determines if a query is a "write" type. @param string An SQL query string @return bool
is_write_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
MIT
public function escape($str) { if (is_bool($str)) { return ($str) ? 'TRUE' : 'FALSE'; } return parent::escape($str); }
"Smart" Escape String Escapes data based on type @param string $str @return mixed
escape
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT "table_name" FROM "information_schema"."tables" WHERE "table_schema" = \''.$this->schema."'"; if ($prefix_limit === TRUE && $this->dbprefix !== '') { return $sql.' AND "table_name" LIKE \'' .$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
MIT
protected function _list_columns($table = '') { return 'SELECT "column_name" FROM "information_schema"."columns" WHERE LOWER("table_name") = '.$this->escape(strtolower($table)); }
List column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
MIT
public function field_data($table) { $sql = 'SELECT "column_name", "data_type", "character_maximum_length", "numeric_precision", "column_default" FROM "information_schema"."columns" WHERE LOWER("table_name") = '.$this->escape(strtolower($table)); if (($query = $this->query($sql)) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->column_name; $retval[$i]->type = $query[$i]->data_type; $retval[$i]->max_length = ($query[$i]->character_maximum_length > 0) ? $query[$i]->character_maximum_length : $query[$i]->numeric_precision; $retval[$i]->default = $query[$i]->column_default; } return $retval; }
Returns an object with field data @param string $table @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
MIT
protected function _update($table, $values) { $this->qb_limit = FALSE; $this->qb_orderby = array(); return parent::_update($table, $values); }
Update statement Generates a platform-specific update string from the supplied data @param string $table @param array $values @return string
_update
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
MIT
protected function _delete($table) { $this->qb_limit = FALSE; return parent::_delete($table); }
Delete statement Generates a platform-specific delete string from the supplied data @param string $table @return string
_delete
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
MIT
protected function _attr_auto_increment(&$attributes, &$field) { // Not supported (in most databases at least) }
Field attribute AUTO_INCREMENT @param array &$attributes @param array &$field @return void
_attr_auto_increment
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_odbc_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_odbc_forge.php
MIT
protected function _attr_type(&$attributes) { switch (strtoupper($attributes['TYPE'])) { case 'TINYINT': $attributes['TYPE'] = 'SMALLINT'; $attributes['UNSIGNED'] = FALSE; return; case 'MEDIUMINT': $attributes['TYPE'] = 'INTEGER'; $attributes['UNSIGNED'] = FALSE; return; case 'LONGTEXT': $attributes['TYPE'] = 'STRING'; return; default: return; } }
Field attribute TYPE Performs a data type mapping between different databases. @param array &$attributes @return void
_attr_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_cubrid_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_cubrid_forge.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = 'firebird:'; if ( ! empty($this->database)) { $this->dsn .= 'dbname='.$this->database; } elseif ( ! empty($this->hostname)) { $this->dsn .= 'dbname='.$this->hostname; } empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; empty($this->role) OR $this->dsn .= ';role='.$this->role; } elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 9) === FALSE) { $this->dsn .= ';charset='.$this->char_set; } }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT "RDB$RELATION_NAME" FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\''; if ($prefix_limit === TRUE && $this->dbprefix !== '') { return $sql.' AND "RDB$RELATION_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
protected function _list_columns($table = '') { return 'SELECT "RDB$FIELD_NAME" FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
public function field_data($table) { $sql = 'SELECT "rfields"."RDB$FIELD_NAME" AS "name", CASE "fields"."RDB$FIELD_TYPE" WHEN 7 THEN \'SMALLINT\' WHEN 8 THEN \'INTEGER\' WHEN 9 THEN \'QUAD\' WHEN 10 THEN \'FLOAT\' WHEN 11 THEN \'DFLOAT\' WHEN 12 THEN \'DATE\' WHEN 13 THEN \'TIME\' WHEN 14 THEN \'CHAR\' WHEN 16 THEN \'INT64\' WHEN 27 THEN \'DOUBLE\' WHEN 35 THEN \'TIMESTAMP\' WHEN 37 THEN \'VARCHAR\' WHEN 40 THEN \'CSTRING\' WHEN 261 THEN \'BLOB\' ELSE NULL END AS "type", "fields"."RDB$FIELD_LENGTH" AS "max_length", "rfields"."RDB$DEFAULT_VALUE" AS "default" FROM "RDB$RELATION_FIELDS" "rfields" JOIN "RDB$FIELDS" "fields" ON "rfields"."RDB$FIELD_SOURCE" = "fields"."RDB$FIELD_NAME" WHERE "rfields"."RDB$RELATION_NAME" = '.$this->escape($table).' ORDER BY "rfields"."RDB$FIELD_POSITION"'; return (($query = $this->query($sql)) !== FALSE) ? $query->result_object() : FALSE; }
Returns an object with field data @param string $table @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
protected function _update($table, $values) { $this->qb_limit = FALSE; return parent::_update($table, $values); }
Update statement Generates a platform-specific update string from the supplied data @param string $table @param array $values @return string
_update
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
protected function _truncate($table) { return 'DELETE FROM '.$table; }
Truncate statement Generates a platform-specific truncate string from the supplied data If the database does not support the TRUNCATE statement, then this method maps to 'DELETE FROM table' @param string $table @return string
_truncate
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
protected function _delete($table) { $this->qb_limit = FALSE; return parent::_delete($table); }
Delete statement Generates a platform-specific delete string from the supplied data @param string $table @return string
_delete
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
protected function _limit($sql) { // Limit clause depends on if Interbase or Firebird if (stripos($this->version(), 'firebird') !== FALSE) { $select = 'FIRST '.$this->qb_limit .($this->qb_offset > 0 ? ' SKIP '.$this->qb_offset : ''); }
LIMIT Generates a platform-specific LIMIT clause @param string $sql SQL Query @return string
_limit
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
protected function _insert_batch($table, $keys, $values) { return ($this->db_debug) ? $this->display_error('db_unsupported_feature') : FALSE; }
Insert batch statement Generates a platform-specific insert string from the supplied data. @param string $table Table name @param array $keys INSERT keys @param array $values INSERT values @return string|bool
_insert_batch
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = '4D:host='.(empty($this->hostname) ? '127.0.0.1' : $this->hostname); empty($this->port) OR $this->dsn .= ';port='.$this->port; empty($this->database) OR $this->dsn .= ';dbname='.$this->database; empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT '.$this->escape_identifiers('TABLE_NAME').' FROM '.$this->escape_identifiers('_USER_TABLES'); if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' WHERE '.$this->escape_identifiers('TABLE_NAME')." LIKE '".$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
MIT
protected function _list_columns($table = '') { return 'SELECT '.$this->escape_identifiers('COLUMN_NAME').' FROM '.$this->escape_identifiers('_USER_COLUMNS') .' WHERE '.$this->escape_identifiers('TABLE_NAME').' = '.$this->escape($table); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
MIT
protected function _field_data($table) { return 'SELECT * FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE).' LIMIT 1'; }
Field data query Generates a platform-specific query so that the column data can be retrieved @param string $table @return string
_field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
MIT
protected function _update($table, $values) { $this->qb_limit = FALSE; $this->qb_orderby = array(); return parent::_update($table, $values); }
Update statement Generates a platform-specific update string from the supplied data @param string $table @param array $values @return string
_update
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
MIT
protected function _delete($table) { $this->qb_limit = FALSE; return parent::_delete($table); }
Delete statement Generates a platform-specific delete string from the supplied data @param string $table @return string
_delete
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = $params['subdriver'].':host='.(empty($this->hostname) ? '127.0.0.1' : $this->hostname); if ( ! empty($this->port)) { $this->dsn .= (DIRECTORY_SEPARATOR === '\\' ? ',' : ':').$this->port; } empty($this->database) OR $this->dsn .= ';dbname='.$this->database; empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; empty($this->appname) OR $this->dsn .= ';appname='.$this->appname; }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT '.$this->escape_identifiers('name') .' FROM '.$this->escape_identifiers('sysobjects') .' WHERE '.$this->escape_identifiers('type')." = 'U'"; if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql.' ORDER BY '.$this->escape_identifiers('name'); }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
MIT
protected function _list_columns($table = '') { return 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table)); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
MIT
public function field_data($table) { $sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.Columns WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table)); if (($query = $this->query($sql)) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->COLUMN_NAME; $retval[$i]->type = $query[$i]->DATA_TYPE; $retval[$i]->max_length = ($query[$i]->CHARACTER_MAXIMUM_LENGTH > 0) ? $query[$i]->CHARACTER_MAXIMUM_LENGTH : $query[$i]->NUMERIC_PRECISION; $retval[$i]->default = $query[$i]->COLUMN_DEFAULT; } return $retval; }
Returns an object with field data @param string $table @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
MIT
protected function _update($table, $values) { $this->qb_limit = FALSE; $this->qb_orderby = array(); return parent::_update($table, $values); }
Update statement Generates a platform-specific update string from the supplied data @param string $table @param array $values @return string
_update
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
MIT
protected function _delete($table) { if ($this->qb_limit) { return 'WITH ci_delete AS (SELECT TOP '.$this->qb_limit.' * FROM '.$table.$this->_compile_wh('qb_where').') DELETE FROM ci_delete'; } return parent::_delete($table); }
Delete statement Generates a platform-specific delete string from the supplied data @param string $table @return string
_delete
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
MIT
protected function _limit($sql) { $limit = $this->qb_offset + $this->qb_limit; // As of SQL Server 2005 (9.0.*) ROW_NUMBER() is supported, // however an ORDER BY clause is required for it to work if (version_compare($this->version(), '9', '>=') && $this->qb_offset && ! empty($this->qb_orderby)) { $orderby = $this->_compile_order_by(); // We have to strip the ORDER BY clause $sql = trim(substr($sql, 0, strrpos($sql, $orderby))); // Get the fields to select from our subquery, so that we can avoid CI_rownum appearing in the actual results if (count($this->qb_select) === 0 OR strpos(implode(',', $this->qb_select), '*') !== FALSE) { $select = '*'; // Inevitable } else { // Use only field names and their aliases, everything else is out of our scope. $select = array(); $field_regexp = ($this->_quoted_identifier) ? '("[^\"]+")' : '(\[[^\]]+\])'; for ($i = 0, $c = count($this->qb_select); $i < $c; $i++) { $select[] = preg_match('/(?:\s|\.)'.$field_regexp.'$/i', $this->qb_select[$i], $m) ? $m[1] : $this->qb_select[$i]; } $select = implode(', ', $select); } return 'SELECT '.$select." FROM (\n\n" .preg_replace('/^(SELECT( DISTINCT)?)/i', '\\1 ROW_NUMBER() OVER('.trim($orderby).') AS '.$this->escape_identifiers('CI_rownum').', ', $sql) ."\n\n) ".$this->escape_identifiers('CI_subquery') ."\nWHERE ".$this->escape_identifiers('CI_rownum').' BETWEEN '.($this->qb_offset + 1).' AND '.$limit; }
LIMIT Generates a platform-specific LIMIT clause @param string $sql SQL Query @return string
_limit
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
MIT
protected function _insert_batch($table, $keys, $values) { // Multiple-value inserts are only supported as of SQL Server 2008 if (version_compare($this->version(), '10', '>=')) { return parent::_insert_batch($table, $keys, $values); } return ($this->db_debug) ? $this->display_error('db_unsupported_feature') : FALSE; }
Insert batch statement Generates a platform-specific insert string from the supplied data. @param string $table Table name @param array $keys INSERT keys @param array $values INSERT values @return string|bool
_insert_batch
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
MIT
protected function _attr_type(&$attributes) { switch (strtoupper($attributes['TYPE'])) { case 'TINYINT': $attributes['TYPE'] = 'SMALLINT'; $attributes['UNSIGNED'] = FALSE; return; case 'MEDIUMINT': $attributes['TYPE'] = 'INTEGER'; $attributes['UNSIGNED'] = FALSE; return; case 'BYTE': case 'TEXT': case 'BLOB': case 'CLOB': $attributes['UNIQUE'] = FALSE; if (isset($attributes['DEFAULT'])) { unset($attributes['DEFAULT']); } return; default: return; } }
Field attribute TYPE Performs a data type mapping between different databases. @param array &$attributes @return void
_attr_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_informix_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_informix_forge.php
MIT
protected function _attr_auto_increment(&$attributes, &$field) { // Not supported }
Field attribute AUTO_INCREMENT @param array &$attributes @param array &$field @return void
_attr_auto_increment
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_informix_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_informix_forge.php
MIT
protected function _attr_type(&$attributes) { switch (strtoupper($attributes['TYPE'])) { case 'TINYINT': $attributes['TYPE'] = 'SMALLINT'; $attributes['UNSIGNED'] = FALSE; return; case 'MEDIUMINT': $attributes['TYPE'] = 'INTEGER'; $attributes['UNSIGNED'] = FALSE; return; case 'INT': $attributes['TYPE'] = 'INTEGER'; return; case 'BIGINT': $attributes['TYPE'] = 'INT64'; return; default: return; } }
Field attribute TYPE Performs a data type mapping between different databases. @param array &$attributes @return void
_attr_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php
MIT
protected function _attr_auto_increment(&$attributes, &$field) { // Not supported }
Field attribute AUTO_INCREMENT @param array &$attributes @param array &$field @return void
_attr_auto_increment
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php
MIT
protected function _attr_auto_increment(&$attributes, &$field) { // Not supported - sequences and triggers must be used instead }
Field attribute AUTO_INCREMENT @param array &$attributes @param array &$field @return void
_attr_auto_increment
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
MIT
protected function _attr_type(&$attributes) { switch (strtoupper($attributes['TYPE'])) { case 'TINYINT': $attributes['TYPE'] = 'NUMBER'; return; case 'MEDIUMINT': $attributes['TYPE'] = 'NUMBER'; return; case 'INT': $attributes['TYPE'] = 'NUMBER'; return; case 'BIGINT': $attributes['TYPE'] = 'NUMBER'; return; default: return; } }
Field attribute TYPE Performs a data type mapping between different databases. @param array &$attributes @return void
_attr_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = 'cubrid:host='.(empty($this->hostname) ? '127.0.0.1' : $this->hostname); empty($this->port) OR $this->dsn .= ';port='.$this->port; empty($this->database) OR $this->dsn .= ';dbname='.$this->database; empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SHOW TABLES'; if ($prefix_limit === TRUE && $this->dbprefix !== '') { return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
MIT
protected function _list_columns($table = '') { return 'SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
MIT
public function field_data($table) { if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->Field; sscanf($query[$i]->Type, '%[a-z](%d)', $retval[$i]->type, $retval[$i]->max_length ); $retval[$i]->default = $query[$i]->Default; $retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); } return $retval; }
Returns an object with field data @param string $table @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
MIT
protected function _truncate($table) { return 'TRUNCATE '.$table; }
Truncate statement Generates a platform-specific truncate string from the supplied data If the database does not support the TRUNCATE statement, then this method maps to 'DELETE FROM table' @param string $table @return string
_truncate
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
MIT
protected function _from_tables() { if ( ! empty($this->qb_join) && count($this->qb_from) > 1) { return '('.implode(', ', $this->qb_from).')'; } return implode(', ', $this->qb_from); }
FROM tables Groups tables in FROM clauses if needed, so there is no confusion about operator precedence. @return string
_from_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = 'ibm:'; // Pre-defined DSN if (empty($this->hostname) && empty($this->HOSTNAME) && empty($this->port) && empty($this->PORT)) { if (isset($this->DSN)) { $this->dsn .= 'DSN='.$this->DSN; } elseif ( ! empty($this->database)) { $this->dsn .= 'DSN='.$this->database; } return; } $this->dsn .= 'DRIVER='.(isset($this->DRIVER) ? '{'.$this->DRIVER.'}' : '{IBM DB2 ODBC DRIVER}').';'; if (isset($this->DATABASE)) { $this->dsn .= 'DATABASE='.$this->DATABASE.';'; } elseif ( ! empty($this->database)) { $this->dsn .= 'DATABASE='.$this->database.';'; } if (isset($this->HOSTNAME)) { $this->dsn .= 'HOSTNAME='.$this->HOSTNAME.';'; } else { $this->dsn .= 'HOSTNAME='.(empty($this->hostname) ? '127.0.0.1;' : $this->hostname.';'); }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT "tabname" FROM "syscat"."tables" WHERE "type" = \'T\' AND LOWER("tabschema") = '.$this->escape(strtolower($this->database)); if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' AND "tabname" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
MIT
protected function _list_columns($table = '') { return 'SELECT "colname" FROM "syscat"."columns" WHERE LOWER("tabschema") = '.$this->escape(strtolower($this->database)).' AND LOWER("tabname") = '.$this->escape(strtolower($table)); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return array
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
MIT
public function field_data($table) { $sql = 'SELECT "colname" AS "name", "typename" AS "type", "default" AS "default", "length" AS "max_length", CASE "keyseq" WHEN NULL THEN 0 ELSE 1 END AS "primary_key" FROM "syscat"."columns" WHERE LOWER("tabschema") = '.$this->escape(strtolower($this->database)).' AND LOWER("tabname") = '.$this->escape(strtolower($table)).' ORDER BY "colno"'; return (($query = $this->query($sql)) !== FALSE) ? $query->result_object() : FALSE; }
Returns an object with field data @param string $table @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
MIT
protected function _update($table, $values) { $this->qb_limit = FALSE; $this->qb_orderby = array(); return parent::_update($table, $values); }
Update statement Generates a platform-specific update string from the supplied data @param string $table @param array $values @return string
_update
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
MIT
protected function _delete($table) { $this->qb_limit = FALSE; return parent::_delete($table); }
Delete statement Generates a platform-specific delete string from the supplied data @param string $table @return string
_delete
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = 'sqlsrv:Server='.(empty($this->hostname) ? '127.0.0.1' : $this->hostname); empty($this->port) OR $this->dsn .= ','.$this->port; empty($this->database) OR $this->dsn .= ';Database='.$this->database; // Some custom options if (isset($this->QuotedId)) { $this->dsn .= ';QuotedId='.$this->QuotedId; $this->_quoted_identifier = (bool) $this->QuotedId; } if (isset($this->ConnectionPooling)) { $this->dsn .= ';ConnectionPooling='.$this->ConnectionPooling; } if ($this->encrypt === TRUE) { $this->dsn .= ';Encrypt=1'; } if (isset($this->TraceOn)) { $this->dsn .= ';TraceOn='.$this->TraceOn; } if (isset($this->TrustServerCertificate)) { $this->dsn .= ';TrustServerCertificate='.$this->TrustServerCertificate; } empty($this->APP) OR $this->dsn .= ';APP='.$this->APP; empty($this->Failover_Partner) OR $this->dsn .= ';Failover_Partner='.$this->Failover_Partner; empty($this->LoginTimeout) OR $this->dsn .= ';LoginTimeout='.$this->LoginTimeout; empty($this->MultipleActiveResultSets) OR $this->dsn .= ';MultipleActiveResultSets='.$this->MultipleActiveResultSets; empty($this->TraceFile) OR $this->dsn .= ';TraceFile='.$this->TraceFile; empty($this->WSID) OR $this->dsn .= ';WSID='.$this->WSID; }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT '.$this->escape_identifiers('name') .' FROM '.$this->escape_identifiers('sysobjects') .' WHERE '.$this->escape_identifiers('type')." = 'U'"; if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql.' ORDER BY '.$this->escape_identifiers('name'); }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
MIT
protected function _list_columns($table = '') { return 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table)); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
MIT
public function field_data($table) { $sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.Columns WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table)); if (($query = $this->query($sql)) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->COLUMN_NAME; $retval[$i]->type = $query[$i]->DATA_TYPE; $retval[$i]->max_length = ($query[$i]->CHARACTER_MAXIMUM_LENGTH > 0) ? $query[$i]->CHARACTER_MAXIMUM_LENGTH : $query[$i]->NUMERIC_PRECISION; $retval[$i]->default = $query[$i]->COLUMN_DEFAULT; } return $retval; }
Returns an object with field data @param string $table @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
MIT
protected function _update($table, $values) { $this->qb_limit = FALSE; $this->qb_orderby = array(); return parent::_update($table, $values); }
Update statement Generates a platform-specific update string from the supplied data @param string $table @param array $values @return string
_update
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
MIT
protected function _delete($table) { if ($this->qb_limit) { return 'WITH ci_delete AS (SELECT TOP '.$this->qb_limit.' * FROM '.$table.$this->_compile_wh('qb_where').') DELETE FROM ci_delete'; } return parent::_delete($table); }
Delete statement Generates a platform-specific delete string from the supplied data @param string $table @return string
_delete
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
MIT
protected function _limit($sql) { // As of SQL Server 2012 (11.0.*) OFFSET is supported if (version_compare($this->version(), '11', '>=')) { // SQL Server OFFSET-FETCH can be used only with the ORDER BY clause empty($this->qb_orderby) && $sql .= ' ORDER BY 1'; return $sql.' OFFSET '.(int) $this->qb_offset.' ROWS FETCH NEXT '.$this->qb_limit.' ROWS ONLY'; }
LIMIT Generates a platform-specific LIMIT clause @param string $sql SQL Query @return string
_limit
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
MIT
protected function _insert_batch($table, $keys, $values) { // Multiple-value inserts are only supported as of SQL Server 2008 if (version_compare($this->version(), '10', '>=')) { return parent::_insert_batch($table, $keys, $values); } return ($this->db_debug) ? $this->display_error('db_unsupported_feature') : FALSE; }
Insert batch statement Generates a platform-specific insert string from the supplied data. @param string $table Table name @param array $keys INSERT keys @param array $values INSERT values @return string|bool
_insert_batch
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
MIT
protected function _attr_type(&$attributes) { if (isset($attributes['CONSTRAINT']) && strpos($attributes['TYPE'], 'INT') !== FALSE) { unset($attributes['CONSTRAINT']); } switch (strtoupper($attributes['TYPE'])) { case 'MEDIUMINT': $attributes['TYPE'] = 'INTEGER'; $attributes['UNSIGNED'] = FALSE; return; case 'INTEGER': $attributes['TYPE'] = 'INT'; return; default: return; } }
Field attribute TYPE Performs a data type mapping between different databases. @param array &$attributes @return void
_attr_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_forge.php
MIT
protected function _attr_auto_increment(&$attributes, &$field) { if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE && stripos($field['type'], 'int') !== FALSE) { $field['auto_increment'] = ' IDENTITY(1,1)'; } }
Field attribute AUTO_INCREMENT @param array &$attributes @param array &$field @return void
_attr_auto_increment
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_sqlsrv_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_forge.php
MIT
public function __construct($params) { parent::__construct($params); if (empty($this->dsn)) { $this->dsn = 'oci:dbname='; // Oracle has a slightly different PDO DSN format (Easy Connect), // which also supports pre-defined DSNs. if (empty($this->hostname) && empty($this->port)) { $this->dsn .= $this->database; } else { $this->dsn .= '//'.(empty($this->hostname) ? '127.0.0.1' : $this->hostname) .(empty($this->port) ? '' : ':'.$this->port).'/'; empty($this->database) OR $this->dsn .= $this->database; }
Class constructor Builds the DSN if not already set. @param array $params @return void
__construct
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT "TABLE_NAME" FROM "ALL_TABLES"'; if ($prefix_limit === TRUE && $this->dbprefix !== '') { return $sql.' WHERE "TABLE_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
MIT
protected function _list_columns($table = '') { if (strpos($table, '.') !== FALSE) { sscanf($table, '%[^.].%s', $owner, $table); } else { $owner = $this->username; } return 'SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE UPPER(OWNER) = '.$this->escape(strtoupper($owner)).' AND UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table)); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
MIT
public function field_data($table) { if (strpos($table, '.') !== FALSE) { sscanf($table, '%[^.].%s', $owner, $table); } else { $owner = $this->username; } $sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHAR_LENGTH, DATA_PRECISION, DATA_LENGTH, DATA_DEFAULT, NULLABLE FROM ALL_TAB_COLUMNS WHERE UPPER(OWNER) = '.$this->escape(strtoupper($owner)).' AND UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table)); if (($query = $this->query($sql)) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->COLUMN_NAME; $retval[$i]->type = $query[$i]->DATA_TYPE; $length = ($query[$i]->CHAR_LENGTH > 0) ? $query[$i]->CHAR_LENGTH : $query[$i]->DATA_PRECISION; if ($length === NULL) { $length = $query[$i]->DATA_LENGTH; } $retval[$i]->max_length = $length; $default = $query[$i]->DATA_DEFAULT; if ($default === NULL && $query[$i]->NULLABLE === 'N') { $default = ''; } $retval[$i]->default = $query[$i]->COLUMN_DEFAULT; } return $retval; }
Returns an object with field data @param string $table @return array
field_data
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
MIT
protected function _delete($table) { if ($this->qb_limit) { $this->where('rownum <= ',$this->qb_limit, FALSE); $this->qb_limit = FALSE; } return parent::_delete($table); }
Delete statement Generates a platform-specific delete string from the supplied data @param string $table @return string
_delete
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
MIT
protected function _limit($sql) { if (version_compare($this->version(), '12.1', '>=')) { // OFFSET-FETCH can be used only with the ORDER BY clause empty($this->qb_orderby) && $sql .= ' ORDER BY 1'; return $sql.' OFFSET '.(int) $this->qb_offset.' ROWS FETCH NEXT '.$this->qb_limit.' ROWS ONLY'; }
LIMIT Generates a platform-specific LIMIT clause @param string $sql SQL Query @return string
_limit
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
MIT
protected function _attr_type(&$attributes) { switch (strtoupper($attributes['TYPE'])) { case 'TINYINT': $attributes['TYPE'] = 'SMALLINT'; $attributes['UNSIGNED'] = FALSE; return; case 'MEDIUMINT': $attributes['TYPE'] = 'INTEGER'; $attributes['UNSIGNED'] = FALSE; return; case 'INTEGER': $attributes['TYPE'] = 'INT'; return; case 'BIGINT': $attributes['TYPE'] = 'INT64'; return; default: return; } }
Field attribute TYPE Performs a data type mapping between different databases. @param array &$attributes @return void
_attr_type
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_4d_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_4d_forge.php
MIT
protected function _attr_auto_increment(&$attributes, &$field) { if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) { if (stripos($field['type'], 'int') !== FALSE) { $field['auto_increment'] = ' AUTO_INCREMENT'; } elseif (strcasecmp($field['type'], 'UUID') === 0) { $field['auto_increment'] = ' AUTO_GENERATE'; } } }
Field attribute AUTO_INCREMENT @param array &$attributes @param array &$field @return void
_attr_auto_increment
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_4d_forge.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_4d_forge.php
MIT
protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT "tabname" FROM "systables" WHERE "tabid" > 99 AND "tabtype" = \'T\' AND LOWER("owner") = '.$this->escape(strtolower($this->username)); if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' AND "tabname" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; }
Show table query Generates a platform-specific query string so that the table names can be fetched @param bool $prefix_limit @return string
_list_tables
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
MIT
protected function _list_columns($table = '') { if (strpos($table, '.') !== FALSE) { sscanf($table, '%[^.].%s', $owner, $table); } else { $owner = $this->username; } return 'SELECT "colname" FROM "systables", "syscolumns" WHERE "systables"."tabid" = "syscolumns"."tabid" AND "systables"."tabtype" = \'T\' AND LOWER("systables"."owner") = '.$this->escape(strtolower($owner)).' AND LOWER("systables"."tabname") = '.$this->escape(strtolower($table)); }
Show column query Generates a platform-specific query string so that the column names can be fetched @param string $table @return string
_list_columns
php
ronknight/InventorySystem
system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
https://github.com/ronknight/InventorySystem/blob/master/system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
MIT
public function getPageNumber() { return $this->page_number; }
Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts from 1. Generated from protobuf field <code>int32 page_number = 2;</code> @return int
getPageNumber
php
googleapis/google-cloud-php
AutoMl/src/V1/Document/Layout.php
https://github.com/googleapis/google-cloud-php/blob/master/AutoMl/src/V1/Document/Layout.php
Apache-2.0
public function setPageNumber($var) { GPBUtil::checkInt32($var); $this->page_number = $var; return $this; }
Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts from 1. Generated from protobuf field <code>int32 page_number = 2;</code> @param int $var @return $this
setPageNumber
php
googleapis/google-cloud-php
AutoMl/src/V1/Document/Layout.php
https://github.com/googleapis/google-cloud-php/blob/master/AutoMl/src/V1/Document/Layout.php
Apache-2.0
public function getBoundingPoly() { return $this->bounding_poly; }
The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. Contains exactly 4 [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] and they are connected by edges in the order provided, which will represent a rectangle parallel to the frame. The [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are relative to the page. Coordinates are based on top-left as point (0,0). Generated from protobuf field <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> @return \Google\Cloud\AutoMl\V1\BoundingPoly|null
getBoundingPoly
php
googleapis/google-cloud-php
AutoMl/src/V1/Document/Layout.php
https://github.com/googleapis/google-cloud-php/blob/master/AutoMl/src/V1/Document/Layout.php
Apache-2.0
public function setBoundingPoly($var) { GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BoundingPoly::class); $this->bounding_poly = $var; return $this; }
The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. Contains exactly 4 [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] and they are connected by edges in the order provided, which will represent a rectangle parallel to the frame. The [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are relative to the page. Coordinates are based on top-left as point (0,0). Generated from protobuf field <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> @param \Google\Cloud\AutoMl\V1\BoundingPoly $var @return $this
setBoundingPoly
php
googleapis/google-cloud-php
AutoMl/src/V1/Document/Layout.php
https://github.com/googleapis/google-cloud-php/blob/master/AutoMl/src/V1/Document/Layout.php
Apache-2.0
public function getTextSegmentType() { return $this->text_segment_type; }
The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. Generated from protobuf field <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> @return int
getTextSegmentType
php
googleapis/google-cloud-php
AutoMl/src/V1/Document/Layout.php
https://github.com/googleapis/google-cloud-php/blob/master/AutoMl/src/V1/Document/Layout.php
Apache-2.0