Checks if the table exists or not
@param String $tableName
@return boolean
774481
public function isDbTableExists($tableName)
    {
        $status = false;
        $resultSet = array();

        $query = $this->executeRawQuery("SHOW TABLES LIKE '".trim($tableName)."';");
        if($resultSet)
            $resultSet = $query->toArray();



        if(!empty($resultSet)) {
            $status = true;

        }

        return $status;
    }
1362356
public function isExists(string $database, string $table)
    {
        return $this->select(
            '
            SELECT *
            FROM system.tables 
            WHERE name=\'' . $table . '\' AND database=\'' . $database . '\''
        )->rowsAsTree('name');
    }
879608
public function exists()
    {
        $quotedTable = \Database\DatabaseConnectionFactory::get()->quote($this->getTable());
        $record = \Database\DatabaseConnectionFactory::get()->query("show tables like {$quotedTable}");
        return !is_a($record, 'Database\DatabaseRecord\EmptyDatabaseRecord') && count($record->all()) > 0;
    }
1032877
public function getTableUses($tablename) {

        $uses = array();

        // Check if some foreign key in the whole structure is using it
        // (by comparing the reftable with the tablename)
        if ($this->tables) {
            foreach ($this->tables as $table) {
                $keys = $table->getKeys();
                if ($keys) {
                    foreach ($keys as $key) {
                        if ($key->getType() == XMLDB_KEY_FOREIGN) {
                            if ($tablename == $key->getRefTable()) {
                                $uses[] = 'table ' . $table->getName() . ' key ' . $key->getName();
                            }
                        }
                    }
                }
            }
        }

        // Return result
        if (!empty($uses)) {
            return $uses;
        } else {
            return false;
        }
    }
1308655
public function tableExists($table)
	{
		$query = 'SHOW TABLES LIKE ' . str_replace('#__', $this->tablePrefix, $this->quote($table, false));
		$this->setQuery($query)->execute();

		return ($this->getAffectedRows() > 0) ? true : false;
	}
1353785
function exists( $filename = false )
    {
        if ( !$filename )
            $filename = $this->FileName;
        return $this->doExists( $filename );
    }
235550
public function hasTable($name, $caseInsensitive = false)
    {
        if ($caseInsensitive) {
            return isset($this->tablesByLowercaseName[ strtolower($name) ]);
        }

        return isset($this->tablesByName[$name]);
    }
473406
private function checkTableExists($name)
    {
        try {
            $this->client->describeTable(['TableName' => $name]);

            return true;
        } catch (AwsException $e) {
            if ($e->getAwsErrorCode() === 'ResourceNotFoundException') {
                return false;
            }

            throw $e;
        }
    }
826751
public function existsByUsername ($username)
    {
        $entity = $this->er->findOneBy(array('username' => $username));

        if (NULL == $entity) {
            return false;
        } else {
            return true;
        }
    }
574904
public function addTable($tableName)
    {
        $this->tables[$tableName] = new TableMap($tableName, $this);

        return $this->tables[$tableName];
    }
704936
public function ColumnExists($ColumnName) {
      $Result = array_key_exists($ColumnName, $this->ExistingColumns());
      if (!$Result) {
         foreach ($this->ExistingColumns() as $ColName => $Def) {
            if (strcasecmp($ColumnName, $ColName) == 0)
               return TRUE;
         }
         return FALSE;
      }
      return $Result;
   }
1114956
public function table_exists($table) {
        if (is_string($table)) {
            $tablename = $table;
        } else {
            // Calculate the name of the table
            $tablename = $table->getName();
        }

        if ($this->temptables->is_temptable($tablename)) {
            return true;
        }

        // Get all tables in moodle database.
        $tables = $this->mdb->get_tables();
        return isset($tables[$tablename]);
    }
326440
public function isAutoIncrement($tableName) {

		$fields = $this->describeTable($tableName);
		
		foreach ($fields as $field) {
			if ('auto_increment' == $field->Extra) {
				return TRUE;
			}
		}
		
		return FALSE;
		
	}
497643
public function compareTableSchema(string $tableName1, string $tableName2): bool
    {
        $schema1 = $this->getTableSchemaId($tableName1);
        $schema2 = $this->getTableSchemaId($tableName2);

        return $schema1 === $schema2;
    }
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));
  }
956764
protected static function _tableExists($sTable)
    {
        $oConfig = Registry::getConfig();
        $sDbName = $oConfig->getConfigParam('dbName');
        $sQuery = "
            SELECT 1
            FROM information_schema.tables
            WHERE table_schema = ?
            AND table_name = ?
        ";

        return (bool)DatabaseProvider::getDb()->getOne($sQuery, array($sDbName, $sTable));
    }
738582
public function isSearchable(string $tableName): bool
    {
        deprecationWarning(
            __METHOD__ . '() is deprecated. This should be handled by the application/business logic.'
        );

        list(, $tableName) = pluginSplit($tableName);

        $config = (new ModuleConfig(ConfigType::MODULE(), $tableName))->parse();
        if (! property_exists($config, 'table')) {
            return false;
        }

        if (! property_exists($config->table, 'searchable')) {
            return false;
        }

        return (bool)$config->table->searchable;
    }