You are here

function dba_sqlite_show_create_table in Database Administration 7

Generate code for creating table.

File

database/sqlite.inc, line 11
Provides database driver specific commands.

Code

function dba_sqlite_show_create_table($table) {
  $result = db_select('sqlite_master', 'sm')
    ->fields('sm', array(
    'sql',
  ))
    ->condition('tbl_name', $table, '=')
    ->execute();
  $create = '';
  foreach ($result as $row) {
    $create .= "{$row->sql};\n";
  }
  return $create;
}