function DatabaseSchema_sqlite::tableExists

Overrides DatabaseSchema::tableExists

7 calls to DatabaseSchema_sqlite::tableExists()
DatabaseSchema_sqlite::addField in includes/database/sqlite/schema.inc
Add a new field to a table.
DatabaseSchema_sqlite::addIndex in includes/database/sqlite/schema.inc
Add an index.
DatabaseSchema_sqlite::addPrimaryKey in includes/database/sqlite/schema.inc
Add a primary key.
DatabaseSchema_sqlite::addUniqueKey in includes/database/sqlite/schema.inc
Add a unique key.
DatabaseSchema_sqlite::alterTable in includes/database/sqlite/schema.inc
Create a table with a new schema containing the old content.

... See full list

File

includes/database/sqlite/schema.inc, line 21

Class

DatabaseSchema_sqlite

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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.