public function DatabaseSchema_sqlite::findTables
public DatabaseSchema_sqlite::findTables($table_expression)
Find all tables that are like the specified base table name.
Parameters
$table_expression: An SQL expression, for example "simpletest%" (without the quotes). BEWARE: this is not prefixed, the caller should take care of that.
Return value
Array, both the keys and the values are the matching tables.
Overrides DatabaseSchema::findTables
File
- includes/database/sqlite/schema.inc, line 671
- Database schema code for SQLite databases.
Class
Code
public function findTables($table_expression) { // Don't add the prefix, $table_expression already includes the prefix. $info = $this->getPrefixInfo($table_expression, FALSE); // Can't use query placeholders for the schema because the query would have // to be :prefixsqlite_master, which does not work. $result = db_query("SELECT name FROM " . $info['schema'] . ".sqlite_master WHERE type = :type AND name LIKE :table_name", array( ':type' => 'table', ':table_name' => $info['table'], )); return $result->fetchAllKeyed(0, 0); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!database!sqlite!schema.inc/function/DatabaseSchema_sqlite::findTables/7.x