Uses the $writer object to write the table definition $table for $tableName

@param string           $tableName
@param ezcDbSchemaTable $table
2351
private function writeTable( $tableName, ezcDbSchemaTable $table )
    {
        $this->writer->startElement( 'table' );
        $this->writer->startElement( 'name' );
        $this->writer->text( $tableName );
        $this->writer->endElement();
        $this->writer->flush();

        $this->writer->startElement( 'declaration' );
        $this->writer->flush();

        // fields 
        foreach ( $table->fields as $fieldName => $field )
        {
            $this->writer->startElement( 'field' );
            $this->writeField( $fieldName, $field );

            $this->writer->endElement();
            $this->writer->flush();
        }

        // indices
        foreach ( $table->indexes as $indexName => $index )
        {
            $this->writer->startElement( 'index' );
            $this->writeIndex( $indexName, $index );

            $this->writer->endElement();
            $this->writer->flush();
        }
        $this->writer->endElement();
        $this->writer->flush();

        $this->writer->endElement();
    }
736029
public function setTableName(string $tableName): void
    {
        $tableName = trim($tableName);

        if (empty($tableName)) {
            throw new InvalidArgumentException('tableName cannot be empty');
        }

        $this->tableName = $tableName;
    }
530513
protected function validateTableName($tableName = null)
    {
        $tableName = $tableName === null ? $this->tableName : $tableName;

        if ($tableName === null) {
            throw new DbExporterException('Table name is null');
        }

        return $tableName;
    }
1181392
public static function tableColumn(Table $table, string $columnName) : ColumnExpr
    {
        if (!$table->hasColumn($columnName)) {
            throw InvalidArgumentException::format(
                'Invalid table column name for table \'%s\': expecting one of (%s), \'%s\' given',
                $table->getName(), Debug::formatValues($table->getColumnNames()), $columnName
            );
        }

        return new ColumnExpr($table->getName(), $table->findColumn($columnName));
    }
1032982
public function deleteTable($tableName)
    {
        try {
            $this->db->deleteTable($tableName);
        } catch (\Exception $e) {
            throw new DbException($e->getMessage());
        }
    }
127919
protected function createCacheTable($db,$tableName)
	{
		$driver=$db->getDriverName();
		if($driver==='mysql')
			$blob='LONGBLOB';
		elseif($driver==='pgsql')
			$blob='BYTEA';
		else
			$blob='BLOB';
		$sql=<<<EOD
CREATE TABLE $tableName
(
	id CHAR(128) PRIMARY KEY,
	expire INTEGER,
	value $blob
)
EOD;
		$db->createCommand($sql)->execute();
	}
369699
public function hasTable($tableName)
    {
        if ($tableName instanceof Model) {
            $tableName = $tableName->tableName();
        }

        return $this->connection->getSchemaManager()->tablesExist([$tableName]);
    }
84506
public function db($name, $tableInfo) {
    $this->db = $name;

        foreach ($tableInfo as $tableName=>$tableArr){
        $this->define('table', $tableName);

            foreach($tableArr as $colnames){
            $this->define('col', $colnames);
            }
        $this->run();
        $this->checkIndex();
        }

    }
164378
public function forget($tableName)
    {
        $capsules = $this->all();
        $keep = [];

        foreach ($capsules as $capsule) {
            if ($capsule->tableName == $tableName) {
                $capsule->forgetAllMigrations();

                continue;
            }

            $keep[] = $capsule;
        }

        $this->write($keep);

        return $keep;
    }
572116
public function setTableName($tableName)
    {
        if (trim($tableName) == '') {
            $tableName = null;
        }
        $this->tableName = $tableName;

        return $this;
    }
375097
public function runMongoBulkWrite($tableName, BulkWrite $bulk)
    {
        $this->reset();
        $return = false;

        try {
            $return = $this->getMaster()->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY_PREFERRED))
                ->executeBulkWrite($this->getDbName() . ".{$tableName}", $bulk);
        } catch (BulkWriteException $e) {
            $result = $e->getWriteResult();

            // Check if the write concern could not be fulfilled
            if ($writeConcernError = $result->getWriteConcernError()) {
                throw new \RuntimeException(sprintf("%s (%d): %s\n",
                    $writeConcernError->getMessage(),
                    $writeConcernError->getCode(),
                    var_export($writeConcernError->getInfo(), true)
                ), 0, $e);
            }

            $errors = [];
            // Check if any write operations did not complete at all
            foreach ($result->getWriteErrors() as $writeError) {
                $errors[] = sprintf("Operation#%d: %s (%d)\n",
                    $writeError->getIndex(),
                    $writeError->getMessage(),
                    $writeError->getCode()
                );
            }
            throw new \RuntimeException(var_export($errors, true), 0, $e);
        } catch (MongoDBDriverException $e) {
            throw new \UnexpectedValueException(sprintf("Other error: %s\n", $e->getMessage()), 0, $e);
        }

        return $return;
    }
297365
protected function tableExists($tableName)
    {
        $tables = $this->connection->getSchemaManager()->listTables();

        foreach ($tables as $table) {
            if ($table->getName() == $tableName) {
                return true;
            }
        }

        return false;
    }
1106351
protected function tableExist($tableName)
    {
        /** @var \Doctrine\DBAL\Schema\AbstractSchemaManager $sm */
        $sm = $this->dbHandler->getConnection()->getSchemaManager();
        foreach ($sm->listTables() as $table) {
            if ($table->getName() == $tableName) {
                return true;
            }
        }

        return false;
    }
874083
protected function generateChangeFieldSql( $tableName, $fieldName, ezcDbSchemaField $fieldDefinition )
    {
        $this->queries[] = "ALTER TABLE '$tableName' CHANGE '$fieldName' " . $this->generateFieldSql( $fieldName, $fieldDefinition );
    }
633389
protected function generateAddFieldSql( $tableName, $fieldName, ezcDbSchemaField $fieldDefinition )
    {
        if ( $fieldDefinition->notNull && $fieldDefinition->default == null ) 
        {
            $fieldDefinition->default = $this->generateDefault( $fieldDefinition->type, 0 );

        }
        $this->queries[] = "ALTER TABLE '$tableName' ADD " . $this->generateFieldSql( $fieldName, $fieldDefinition );
    }
345047
public function insertRecord($tableName, array $data) {
	
		$data = array_change_key_case($data, CASE_LOWER);
	
		if(!$this->tableStructureCache || !array_key_exists($tableName, $this->tableStructureCache) || empty($this->tableStructureCache[$tableName])) {
			$this->fillTableStructureCache($tableName);
		}
	
		if(!array_key_exists($tableName, $this->tableStructureCache)) {
			throw new \PDOException(sprintf("Table '%s' not found.", $tableName));
		}
	
		$attributes = array_keys($this->tableStructureCache[$tableName]);
		$columns = $this->tableStructureCache[$tableName];
	
		$names = [];
		$values = [];
	
		foreach($attributes as $attribute) {
	
			if (array_key_exists($attribute, $data)) {
				$names[]	= $columns[$attribute]['columnName'];
				$values[]	= $data[$attribute];
			}
	
		}
	
		// nothing to do
	
		if(!count($names)) {
			return null;
		}
	
		$valuePlaceholders = implode(', ', array_fill(0, count($values), '?'));
	
		// append create timestamp when applicable
	
		if(
			in_array(static::CREATE_FIELD, $attributes) &&
			!in_array(static::CREATE_FIELD, array_keys($data))
		) {
					
			// for compatibility purposes get the real column name
				
			$names[] = $columns[static::CREATE_FIELD]['columnName'];
			$valuePlaceholders .= ', NOW()';
		}

		// prime and execute statement

        if(
            $this->primeQuery(
				sprintf("
                        INSERT INTO
                            %s
                        (%s%s%s)
                        VALUES
                        (%s)
                        ",
                    static::QUOTE_CHAR . $tableName . static::QUOTE_CHAR,
                    static::QUOTE_CHAR, implode(static::QUOTE_CHAR . ', ' . static::QUOTE_CHAR, $names), static::QUOTE_CHAR,
                    $valuePlaceholders
                ),
                $values
    		)->execute()
		) {
			return $this->connection->lastInsertId();
		}

		throw new \PDOException(vsprintf('ERROR: %s, %s, %s', $this->statement->errorInfo()));
	
	}
609567
public int deleteByTableName(String tableName) throws SQLException {

		DeleteBuilder<Extensions, Void> db = deleteBuilder();

		db.where().eq(Extensions.COLUMN_TABLE_NAME, tableName);

		int deleted = db.delete();

		return deleted;
	}