Check whether the given table exists
@param $table_name The table's name
@param which_connection see method close
@return
- True The table exists
- False The table doesn't exist
- -1 Operation not supported for this database type
194730
public function tableExists($table_name,$which_connection='')
    {
        /**
          Check whether the definition is in cache
        */
        if (isset($this->structure_cache[$which_connection]) && isset($this->structure_cache[$which_connection][$table_name])) {
            return true;
        }

        $conn = $this->getNamedConnection($which_connection);
        if (!is_object($conn)) {
            return false;
        }
        $cols = $conn->MetaColumns($table_name);
        if ($cols === false) {
            return false;
        }

        return true;
    }
980193
public boolean existsView(final Connection _con,
                              final String _viewName)
        throws SQLException
    {
        boolean ret = false;

        final DatabaseMetaData metaData = _con.getMetaData();

        // first test with lower case
        final ResultSet rs = metaData.getTables(null, null, _viewName.toLowerCase(), new String[] { "VIEW" });
        if (rs.next()) {
            ret = true;
        }
        rs.close();

        // then test with upper case
        if (!ret) {
            final ResultSet rsUC = metaData.getTables(null, null, _viewName.toUpperCase(), new String[] { "VIEW" });
            if (rsUC.next()) {
                ret = true;
            }
            rsUC.close();
        }

        return ret;
    }
755081
public function table_exists() {
		return (bool) $this->db->get_row( $this->db->prepare('SHOW TABLES LIKE %s', $this->table ) );
	}
313287
def _table_exists(self):
        """"""
        self.cursor.execute("SHOW TABLES")
        for table in self.cursor.fetchall():
            if table[0].lower() == self.name.lower():
                return True
        return False
1164422
def exists(table_name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        conn.describe_table(table_name)
    except JSONResponseError as e:
        if e.error_code == 'ResourceNotFoundException':
            return False
        raise

    return True
348014
function exists(name, db) {
  return db(db.raw('information_schema.tables')).count('table_name').where('table_name', name).then(function (resp) {
    if (resp.length !== 1) {
      throw new Error('invalid response');
    }
    if (typeof resp[0].count !== 'number') {
      throw new Error('invalid response');
    }
    return resp[0].count;
  });
}
197197
public function temporaryTable($name, $source_table, $which_connection='')
    {
        $which_connection = $which_connection === '' ? $this->default_db : $which_connection;
        $adapter = $this->getAdapter($this->connectionType($which_connection));
        $query = $adapter->temporaryTable($name, $source_table);
        $created = $this->query($query, $which_connection);
        return $created ? $name : false;
    }
122512
public function sessdb_table_exists() {
		try {
			$this->db->run_query("SELECT * FROM ". self::tableName .
					" ORDER BY ". self::tablePKey ." LIMIT 1");
			$exists = true;
		}
		catch(exception $e) {
			$this->exception_handler(__METHOD__ .": exception while trying to detect table::: ". $e->getMessage());
			$exists = false;
		}
		
		return($exists);
	}
722388
def table_exists(self, tablename: str) -> bool:
        """"""
        # information_schema is ANSI standard
        sql = """
            SELECT COUNT(*)
            FROM information_schema.tables
            WHERE table_name=?
            AND table_schema={}
        """.format(self.get_current_schema_expr())
        row = self.fetchone(sql, tablename)
        return True if row[0] >= 1 else False
651311
public static boolean tableExists(Connection connection, String tableName) throws SQLException {
        try (Statement statement = connection.createStatement()) {
            statement.execute("SELECT * FROM " + TableLocation.parse(tableName) + " LIMIT 0;");
            return true;
        } catch (SQLException ex) {
            return false;
        }
    }
1343052
public function error($which_connection='')
    {
        $con = $this->getNamedConnection($which_connection);

        if (!is_object($con)) {
            if ($this->last_connect_error) {
                return $this->last_connect_error;
            }

            return 'No database connection';
        }

        return $con->ErrorMsg();
    }
13627
private function triggerExists($trigger_name)
    {
        if ($triggers = $this->getConnection()->execute('SHOW TRIGGERS', $trigger_name)) {
            foreach ($triggers as $trigger) {
                if ($trigger['Trigger'] == $trigger_name) {
                    return true;
                }
            }
        }

        return false;
    }
369699
public function hasTable($tableName)
    {
        if ($tableName instanceof Model) {
            $tableName = $tableName->tableName();
        }

        return $this->connection->getSchemaManager()->tablesExist([$tableName]);
    }
1175875
public function matchingColumns($table1, $table2, $which_connection='')
    {
        if ($which_connection == '') {
            $which_connection=$this->default_db;
        }
        
        $definition1 = $this->tableDefinition($table1, $which_connection);
        $definition2 = $this->tableDefinition($table2, $which_connection);
        if (!is_array($definition1) || ! is_array($definition2)) {
            return array();
        }

        $matches = array_filter(array_keys($definition1),
            function ($col_name) use ($definition2) {
                return isset($definition2[$col_name]) ? true : false;
            }
        );

        return $matches;
    }
674088
public function table($table_name)
    {
        $table_name = trim($table_name);

        if (is_null($table_name)) {
            $this->throwFailsCommand('Specify the seeder table name', 'help seed');
        }

        if (!file_exists($this->setting->getSeederDirectory()."/{$table_name}_seeder.php")) {
            echo Color::red("Seeder $table_name not exists.");

            exit(1);
        }

        $this->make([
            $this->setting->getSeederDirectory()."/{$table_name}_seeder.php"
        ]);
    }
1370587
public function tableExists($tableName) {
        $tables = $this->query("SHOW TABLES");
        foreach ($tables as $k => $table) {
            $key = 'Tables_in_' . $this->config['table'];
            if (strtolower($table[$key]) == strtolower($this->getPrefix() . $tableName)) {
                return TRUE;
            }
        }
        return FALSE;
    }
462535
public static boolean doesTableExist(JdbcOperations jdbcOperations, final String table) {

        final boolean tableExists =
                jdbcOperations.execute(
                        new ConnectionCallback<Boolean>() {
                            @Override
                            public Boolean doInConnection(Connection con)
                                    throws SQLException, DataAccessException {

                                final DatabaseMetaData metaData = con.getMetaData();
                                final ResultSet tables =
                                        metaData.getTables(
                                                null, null, null, new String[] {"TABLE"});
                                while (tables.next()) {
                                    final String dbTableName = tables.getString("TABLE_NAME");
                                    if (table.equalsIgnoreCase(dbTableName)) {
                                        return true;
                                    }
                                }

                                return false;
                            }
                        });
        return tableExists;
    }