Generate create table variable.

@param array  $table
@param string $tableName

@return string
489293
protected function getTableVariable($table, $tableName)
    {
        $options = $this->getTableOptions($table);
        $result = sprintf("%s\$table = \$this->table(\"%s\", %s);", $this->ind2, $tableName, $options);

        return $result;
    }
857309
private function getTableStructure($tableName)
    {
        if (!$this->dumpSettings['no-create-info']) {
            $ret = '';
            if (!$this->dumpSettings['skip-comments']) {
                $ret = "--".PHP_EOL.
                    "-- Table structure for table `$tableName`".PHP_EOL.
                    "--".PHP_EOL.PHP_EOL;
            }
            $stmt = $this->typeAdapter->show_create_table($tableName);
            foreach ($this->dbHandler->query($stmt) as $r) {
                $this->compressManager->write($ret);
                if ($this->dumpSettings['add-drop-table']) {
                    $this->compressManager->write(
                        $this->typeAdapter->drop_table($tableName)
                    );
                }
                $this->compressManager->write(
                    $this->typeAdapter->create_table($r)
                );
                break;
            }
        }
        $this->tableColumnTypes[$tableName] = $this->getTableColumnTypes($tableName);
        return;
    }
428858
public function getTable($tableName, array $map = null)
    {
        if (($map === null) && (is_string($tableName))) {
            if (isset($this->cacheTables[$tableName])) {
                $table = $this->cacheTables[$tableName];
            } else {
                $table = new Table($this, $tableName);
                $this->cacheTables[$tableName] = $table;
            }
        } else {
            $table = new Table($this, $tableName, $map);
        }
        return $table;
    }
204142
public CompletableFuture<Void> createTable(String tableName) {
        log.debug("create table called for table: {}", tableName);

        return Futures.toVoid(withRetries(() -> segmentHelper.createTableSegment(tableName, authToken.get(), RequestTag.NON_EXISTENT_ID),
                () -> String.format("create table: %s", tableName)))
                .whenCompleteAsync((r, e) -> {
                    if (e != null) {
                        log.warn("create table {} threw exception", tableName, e);
                    } else {
                        log.debug("table {} created successfully", tableName);
                    }
                }, executor);
    }
873476
public function insert(array $data, $table = null)
    {
        $table = ($table) ?: $this->getTable();
        $sql = $this->getSql();
        $insert = $sql->insert($table);

        $insert->values($data);

        $statement = $sql->prepareStatementForSqlObject($insert);
        $result = $statement->execute();

        return $result->getGeneratedValue();
    }
220502
public function createTable($table)
    {
        $changeSetElt = $this->createChangeSet('create-table-' . $table->getName());

        $createTableElt = $this->document->createElement('createTable');

        $tableName = QualifiedName::fromAsset($table);
        if ($tableName->getNamespaceName()) {
            $createTableElt->setAttribute('schemaName', $tableName->getNamespaceName());
        }
        $createTableElt->setAttribute('tableName', $tableName->getName());

        $indexColumns = new IndexColumns($table);

        foreach ($table->getColumns() as $column) {
            $columnElt = $this->document->createElement('column');

            $this->fillColumnAttributes($columnElt, $column, $indexColumns);

            $createTableElt->appendChild($columnElt);
        }

        $changeSetElt->appendChild($createTableElt);

        foreach ($indexColumns->getOtherIndexes() as $index) {
            $createIndexElt = $this->document->createElement('createIndex');

            if ($tableName->getNamespaceName()) {
                $createIndexElt->setAttribute('schemaName', $tableName->getNamespaceName());
            }
            $createIndexElt->setAttribute('tableName', $tableName->getName());
            $createIndexElt->setAttribute('indexName', $index->getName());
            if ($index->isUnique()) {
                $createIndexElt->setAttribute('unique', $index->isUnique() ? "true" : "false");
            }

            foreach ($index->getColumns() as $column) {
                $columnElt = $this->document->createElement('column');
                $columnElt->setAttribute('name', $column);
                $createIndexElt->appendChild($columnElt);
            }

            $changeSetElt->appendChild($createIndexElt);
        }

        $this->root->appendChild($changeSetElt);
    }
942505
public function create($name = '')
    {
        $tables = $this->argument('tables') ? $this->argument('tables') : '*';
        $return = BackupFacade::backup($tables, $name);
        if (true === $return) {
            $this->info(sprintf('%s backup file generated in %s path', $name,
                BackupLoader::generatePath($name)));
        } else {
            $this->error(sprintf('%s cant create, file already exists', $name));
        }
    }
979360
public function createTable(Table $table)
    {
        $createFlags = AbstractPlatform::CREATE_INDEXES|AbstractPlatform::CREATE_FOREIGNKEYS;
        $this->_execSql($this->_platform->getCreateTableSQL($table, $createFlags));
    }
69797
protected function createSessionTable($db,$tableName)
	{
		switch($db->getDriverName())
		{
			case 'mysql':
				$blob='LONGBLOB';
				break;
			case 'pgsql':
				$blob='BYTEA';
				break;
			case 'sqlsrv':
			case 'mssql':
			case 'dblib':
				$blob='VARBINARY(MAX)';
				break;
			default:
				$blob='BLOB';
				break;
		}
		$db->createCommand()->createTable($tableName,array(
			'id'=>'CHAR(32) PRIMARY KEY',
			'expire'=>'integer',
			'data'=>$blob,
		));
	}
1296765
private function createTable($entityName)
    {
        $prefix        = '';
        $schemaManager = $this->repositoryFactory->getSchemaManager();

        if ($schemaManager !== null) {
            $meta      = $this->entityDefinitions[$entityName];
            $tableName = $prefix . $meta->storage['table'];
            $table     = new Table($tableName);

            foreach ($meta->fields as $field) {
                // @todo add proper type handling
                $type = 'string';

                if (in_array($field->type, ['int', 'integer', 'id'])) {
                    $type = 'integer';
                }

                $table->addColumn($field->columnName($field->name), $type, ['notNull' => false]);
            }

            $primary = explode(',', $meta->primary);
            $table->setPrimaryKey($primary);

            $schemaManager->dropAndCreateTable($table);
        }
    }
210440
public function createTable($table, $options)
    {
        $table = $this->buildRealTableName($table);
        $sql = $this->getSchema()->getCreateTableSql($table, $options);
        $ret = $this->query($sql);
        return $ret;
    }
382669
public function createTable($tableName)
    {
        $table = new Table($tableName);
        $this->_addTable($table);

        foreach ($this->_schemaConfig->getDefaultTableOptions() as $name => $value) {
            $table->addOption($name, $value);
        }

        return $table;
    }
1294520
public function getSqlCreateTable($table)
    {
        if (empty($this->sqlCreateTable[$table])) {
            $query = $this->pdo->query("SHOW CREATE TABLE $table");

            $this->sqlCreateTable[$table] = $query->fetchColumn(1);
        }

        return $this->sqlCreateTable[$table];
    }
1168211
function generateTableSchema( $tableName, $table, $params )
    {
        return $this->generateTableSQL( $tableName, $table, $params, false, false );
    }
182136
public function createTable($tableName, $tableConfig = null)
    {
        if ($this->hasTable($tableName)) {
            throw new RuntimeException("Table with name {$tableName} is exist. Use rewriteTable()");
        }

        return $this->create($tableName, $tableConfig);
    }
1344161
function generateTableInsert( $tableName, $tableDef, $dataEntries, $params )
    {
        return $this->OtherSchema->generateTableInsert( $tableName, $tableDef, $dataEntries, $params );
    }
30925
function generateTableSQLList( $tableName, $table, $params, $separateTypes )
    {
        return $this->generateTableSQL( $tableName, $table, $params, true, $separateTypes );
    }