public function DatabaseSchema_sqlite::tableExists
7.x schema.inc | public DatabaseSchema_sqlite::tableExists($table) |
Check if a table exists.
Parameters
$table: The name of the table in drupal (no prefixing).
Return value
TRUE if the given table exists, otherwise FALSE.
Overrides DatabaseSchema::tableExists
7 calls to DatabaseSchema_sqlite::tableExists()
- DatabaseSchema_sqlite::addField in drupal-7.x/
includes/ database/ sqlite/ schema.inc - Add a new field to a table.
- DatabaseSchema_sqlite::addIndex in drupal-7.x/
includes/ database/ sqlite/ schema.inc - Add an index.
- DatabaseSchema_sqlite::addPrimaryKey in drupal-7.x/
includes/ database/ sqlite/ schema.inc - Add a primary key.
- DatabaseSchema_sqlite::addUniqueKey in drupal-7.x/
includes/ database/ sqlite/ schema.inc - Add a unique key.
- DatabaseSchema_sqlite::alterTable in drupal-7.x/
includes/ database/ sqlite/ schema.inc - Create a table with a new schema containing the old content.
File
- drupal-7.x/
includes/ database/ sqlite/ schema.inc, line 21 - Database schema code for SQLite databases.
Class
Code
public function tableExists($table) {
$info = $this->getPrefixInfo($table);
// Don't use {} around sqlite_master table.
return (bool) $this->connection->query('SELECT 1 FROM ' . $info['schema'] . '.sqlite_master WHERE type = :type AND name = :name', array(':type' => 'table', ':name' => $info['table']))->fetchField();
}