getTable

@param string $name
@param bool   $new

@return  AbstractTable
495597
public function getTable($name, $new = false)
    {
        if (empty($this->tables[$name]) || $new) {
            $class = sprintf('Windwalker\\Database\\Driver\\%s\\%sTable', ucfirst($this->name), ucfirst($this->name));

            $this->tables[$name] = new $class($name, $this);
        }

        return $this->tables[$name];
    }
1143964
public function createTable($name = null)
    {
        if ($name === null) {
            $name = $this->table;
        }
        $stmt = $this->conn->prepare("CREATE TABLE IF NOT EXISTS $name (
			  user_id int(10) unsigned NOT NULL auto_increment,
			  user_name varchar(255) NOT NULL default '',
			  user_pass varchar(60) NOT NULL default '',
			  user_date datetime NOT NULL default '0000-00-00 00:00:00',
			  user_modified datetime NOT NULL default '0000-00-00 00:00:00',
			  user_last_login datetime NULL default NULL,
			  PRIMARY KEY (user_id),
			  UNIQUE KEY user_name (user_name)
			) DEFAULT CHARSET=utf8");
        return $stmt->execute();
    }
1001317
private function loadTable($name, $searchInCacheOnly = false)
    {
        $table = new TableSchema();
        $this->resolveTableNames($table, $name);

        $tablekey = $this->getTableCacheKey($table);
        $cachedTableSchema = Yii::$app->cache->get($tablekey);
        if ($cachedTableSchema !== false) {
            return [$cachedTableSchema, true];
        } else {
            if ($searchInCacheOnly !== true)
                return [parent::loadTableSchema($name), false];
            else
                return [null, false];
        }
    }
113434
public function rename($newName, $returnNew = true)
    {
        $this->db->setQuery(
            'RENAME TABLE ' . $this->db->quoteName($this->getName()) . ' TO ' . $this->db->quoteName($newName)
        );

        $this->db->execute();

        if ($returnNew) {
            return $this->db->getTable($newName);
        }

        return $this->reset();
    }
1319326
public function get(string $name) : Type
    {
        if (! isset($this->instances[$name])) {
            throw DBALException::unknownColumnType($name);
        }

        return $this->instances[$name];
    }
439913
public function getWriter($new = true)
    {
        if (!$this->writer || $new) {
            $class = sprintf('Windwalker\\Database\\Driver\\%s\\%sWriter', ucfirst($this->name), ucfirst($this->name));

            $this->writer = new $class($this);
        }

        return $this->writer;
    }
1271619
public function removeTable(string $name){

            $status = unlink($file = $this->base . '/' . $name . '.json');
            
            return new \NonDB\Components\Status($status);

        }
811193
public static function getOrCreate($name)
    {
        $db = Loader::db();
        $u = new User();
        $v = array($name, $u->getUserID());
        $q = "select pID from Piles where name = ? and uID = ?";
        $pID = $db->getOne($q, $v);

        if ($pID > 0) {
            return self::get($pID);
        }

        $v = array($u->getUserID(), 0, $name, 'READY');
        $q = "insert into Piles (uID, isDefault, name, state) values (?, ?, ?, ?)";
        $r = $db->query($q, $v);
        if ($r) {
            $pID = $db->Insert_ID();

            return self::get($pID);
        }
    }
276970
public function getDatabase($name = null, $new = false)
    {
        $name = $name ?: $this->database;

        if (empty($this->databases[$name]) || $new) {
            $class = sprintf(
                'Windwalker\\Database\\Driver\\%s\\%sDatabase',
                ucfirst($this->name),
                ucfirst($this->name)
            );

            if (!class_exists($class)) {
                throw new \InvalidArgumentException(sprintf('Class %s not exists.', $class));
            }

            $this->databases[$name] = new $class($name, $this);
        }

        return $this->databases[$name];
    }
1102665
public static function getInstance( $name )
    {
        if (! isset( self::$instances[$name] ) )
            self::$instances[$name] = new self( $name );

        return self::$instances[$name];
    }
511942
public function getTable($name)
    {
        return $this->tables->has($name) ? $this->tables[$name] : null;
    }
294243
protected function rename($name)
    {
        if (empty($name)) {
            return Yii::t('podium/flash', 'Installation aborted! New table name missing.');
        }
        try {
            $this->db->createCommand()->renameTable($this->table, $this->getTableName($name))->execute();
            return $this->returnSuccess(Yii::t('podium/flash', 'Table {name} has been renamed to {new}', [
                'name' => $this->rawTable,
                'new'  => $this->getTableName($name)
            ]));
        } catch (Exception $e) {
            return $this->returnError($e->getMessage(), __METHOD__,
                Yii::t('podium/flash', 'Error during table {name} renaming to {new}', [
                    'name' => $this->rawTable,
                    'new'  => $this->getTableName($name)
                ])
            );
        }
    }
607040
public function createTable($name)
    {
        $cloudTable = null;

        try {
            $this->_tableProxy->createTable($name);
            $cloudTable = new CloudTable($name, $this->_tableProxy);
        } catch (\Exception $e) {
            if ($e->getCode() == WindowsAzureErrorCodes::TABLE_ALREADY_EXISTS) {
                $cloudTable = new CloudTable($name, $this->_tableProxy);
            }
        }

        return $cloudTable;
    }
1321671
public function createTable(string $name): Table {
		$metaEntity = new MssqlTable($name);
		$this->database->addMetaEntity($metaEntity);
		return $metaEntity;
	}
1229250
public function getRawSQLName($name)
    {
        $names = $this->metadata[Metadata::RAW_NAMES];
        
        if (isset($names[$name]))
            return $names[$name];
        
        throw new NotFoundException('Cannot found real column name for ":name"', ['name' => $name]);
    }
322734
public function getTableName($name)
    {
        $tableName = null;
        if (isset($this->app['schema.tables'][$name])) {
            /** @var BaseTable $table */
            $table = $this->app['schema.tables'][$name];
            $tableName = $table->getTableName();
        }

        return $tableName;
    }
563965
public function getColumn($name, $alias = '')
    {
        $column = new DerivedColumn($name, $alias);

        return $column->setTable($this);
    }