Deleting table if not exists.

@param $dbname name of database
$table => $table name

@return bool
15433
public function deleteTbl($table)
    {
        $sql = $this->query->deleteTbl($table);
        $this->db->exec($sql);

        return true;
    }
37785
public static function checkTableExists(string $tableName): bool
  {
    $query = sprintf('
select 1
from   information_schema.TABLES
where table_schema = database()
and   table_name   = %s', self::$dl->quoteString($tableName));

    return !empty(self::executeSingleton0($query));
  }
867251
public static function hasTable($tableName)
    {
        // Cache the list of all table names to reduce on DB traffic
        if (empty(self::$_cache_all_tables) && DB::is_active()) {
            self::$_cache_all_tables = DB::get_schema()->tableList();
        }
        return !empty(self::$_cache_all_tables[strtolower($tableName)]);
    }
1097812
public function delete(array $data, $databaseConnectionName = null)
  {
    foreach ($data as $key => $id)
    {
      $Apportionment = $this->byId($id, $databaseConnectionName);
      $Apportionment->delete();
    }
    // $this->Account->destroy($data);

    return true;
  }
1041594
public function tableExists($tableName, $connectionName = 'default')
    {
        try {
            $db = ConnectionManager::get($connectionName);
            $collection = $db->schemaCollection();
            $tables = $collection->listTables();
            if (in_array($tableName, $tables)) {
                return true;
            }
        } catch (PDOException $connectionError) {
            return false;
        }
        return false;
    }
86627
public function getTables($dbName='') {
        $sql    = !empty($dbName)?'SHOW TABLES FROM '.$dbName:'SHOW TABLES ';
        $result = $this->query($sql);
        $info   =   array();
        foreach ($result as $key => $val) {
            $info[$key] = current($val);
        }
        return $info;
    }
875484
public function hasTable($tableName)
    {
        $tableName = $this->getFullQualifiedAssetName($tableName);

        return isset($this->_tables[$tableName]);
    }
884918
protected function tableExists($tableName)
    {
        $rs = $this->getEntityManager()->getConnection()->fetchAll('SHOW TABLE STATUS');

        foreach ($rs as $row) {
            if ($tableName === $row['Name']) {
                return true;
            }
        }

        return false;
    }
920077
protected function _rollback( $dbname = 'db' )
	{
		$dbm = $this->_context->getDatabaseManager();

		$conn = $dbm->acquire( $dbname );
		$conn->rollback();
		$dbm->release( $conn, $dbname );
	}
945220
public function tableExists($tableName)
    {
        $sm = $this->getSchemaManager();
        $schemaTables = $sm->listTableNames();

        return in_array(strtolower($tableName), array_map('strtolower', $schemaTables));
    }
770294
def delete_table(self, tablename):
        
        self.tables = filter(lambda x: x.name != tablename, self.tables)
1234154
public int deleteByTableName(String tableName) throws SQLException {
		DeleteBuilder<FeatureTileLink, FeatureTileLinkKey> db = deleteBuilder();

		db.where().eq(FeatureTileLink.COLUMN_FEATURE_TABLE_NAME, tableName)
				.or().eq(FeatureTileLink.COLUMN_TILE_TABLE_NAME, tableName);

		PreparedDelete<FeatureTileLink> deleteQuery = db.prepare();
		int deleted = delete(deleteQuery);
		return deleted;
	}
716876
public function dropDbTable($tableName)
    {
        $drop = new Ddl\DropTable(trim($tableName));
        $sql  = new Sql($this->getDbAdapter());
        $this->getDbAdapter()->query($sql->getSqlStringForSqlObject($drop), DbAdapter::QUERY_MODE_EXECUTE);
    }
32043
public function delete($username): bool
    {
        $user = $this->load($username);

        $exists = $user->exists();
        if ($exists) {
            $user->delete();
        }

        return $exists;
    }
1282979
public function hasOnDelete()
    {
        $database = $this->getTable()->getDatabase();
        if($database instanceof Database &&
               $this->onDelete === $database->getPlatform()->getDefaultFKOnDeleteBehavior()) {
          return false;
        }

        return ($this->onDelete !== self::NONE);
    }
981940
public function getTables($dbName = '')
    {
        $pdo    = $this->linkID->query("select table_name from all_tables");
        $result = $pdo->fetchAll(PDO::FETCH_ASSOC);
        $info   = [];
        foreach ($result as $key => $val) {
            $info[$key] = current($val);
        }
        return $info;
    }
555361
public static function delete($filename)
    {
        if (is_string($filename) && file_exists($filename)) {
            unlink($filename);
            return true;
        }

        return false;
    }