Get a list of all known keyspaces. This method can be used with any DB connection.

@param  dbConn   Database connection to use.
@return          List of all known keyspaces, empty if none.
557851
public Collection<String> getKeyspaces(DBConn dbConn) {
        List<String> result = new ArrayList<>();
        try {
            for (KsDef ksDef : dbConn.getClientSession().describe_keyspaces()) {
                result.add(ksDef.getName());
            }
        } catch (Exception e) {
            String errMsg = "Failed to get keyspace description";
            m_logger.error(errMsg, e);
            throw new RuntimeException(errMsg, e);
        }
        return result;
    }
797789
public java.util.List<KeyListEntry> getKeys() {
        if (keys == null) {
            keys = new com.ibm.cloud.objectstorage.internal.SdkInternalList<KeyListEntry>();
        }
        return keys;
    }
537141
public static Set<String> getForeignKeys(DriverTypeEnum.ConnectionProperties theConnectionProperties, String theTableName, String theForeignTable) throws SQLException {
		DataSource dataSource = Objects.requireNonNull(theConnectionProperties.getDataSource());
		try (Connection connection = dataSource.getConnection()) {
			return theConnectionProperties.getTxTemplate().execute(t -> {
				DatabaseMetaData metadata;
				try {
					metadata = connection.getMetaData();
					ResultSet indexes = metadata.getCrossReference(connection.getCatalog(), connection.getSchema(), massageIdentifier(metadata, theTableName), connection.getCatalog(), connection.getSchema(), massageIdentifier(metadata, theForeignTable));

					Set<String> columnNames = new HashSet<>();
					while (indexes.next()) {
						String tableName = toUpperCase(indexes.getString("PKTABLE_NAME"), Locale.US);
						if (!theTableName.equalsIgnoreCase(tableName)) {
							continue;
						}
						tableName = toUpperCase(indexes.getString("FKTABLE_NAME"), Locale.US);
						if (!theForeignTable.equalsIgnoreCase(tableName)) {
							continue;
						}

						String fkName = indexes.getString("FK_NAME");
						fkName = toUpperCase(fkName, Locale.US);
						columnNames.add(fkName);
					}

					return columnNames;
				} catch (SQLException e) {
					throw new InternalErrorException(e);
				}
			});
		}
	}
361913
def get_namespace_keys(app, limit):
  """"""
  ns_query = datastore.Query('__namespace__', keys_only=True, _app=app)
  return list(ns_query.Run(limit=limit, batch_size=limit))
958014
def get_table_list(dbconn):
    
    cur = dbconn.cursor()
    cur.execute("SELECT name FROM sqlite_master WHERE type='table';")
    try:
        return [item[0] for item in cur.fetchall()]
    except IndexError:
        return get_table_list(dbconn)
1041170
def list_keys(self, pattern='*', db=0):
        
        lines = output_lines(self.exec_redis_cli('KEYS', [pattern], db=db))
        return [] if lines == [''] else lines
293545
def rpc_get_all_namespaces( self, **con_info ):
        
        db = get_db_state(self.working_dir)
        all_namespaces = db.get_all_namespace_ids()
        db.close()

        return self.success_response( {'namespaces': all_namespaces} )
1198233
public List<Connection> getConnections(final ConnectionMode connectionMode, final String dataSourceName, final int connectionSize) throws SQLException {
        if (stateHandler.isInTransaction()) {
            return getConnectionsWithTransaction(connectionMode, dataSourceName, connectionSize);
        } else {
            return getConnectionsWithoutTransaction(connectionMode, dataSourceName, connectionSize);
        }
    }
648868
@GetMapping(value = "/v1/dbs")
    @ResponseBody
    public List<String> dbs() {
        logger.info("Gettting list of DBs");
        final List<String> list = new ArrayList<>();
        for (final RootDocument mongo : repositoryManager
                .getRootDocumentRepository().findAll()) {
            list.add(mongo.getDbName());
        }
        logger.info("length: " + list.size());
        return list;
    }
371860
@NonNull
  public SelfT withKeyspace(@Nullable String keyspaceName) {
    return withKeyspace(keyspaceName == null ? null : CqlIdentifier.fromCql(keyspaceName));
  }
553593
public java.util.List<DBSecurityGroupMembership> getDBSecurityGroupMemberships() {
        if (dBSecurityGroupMemberships == null) {
            dBSecurityGroupMemberships = new com.amazonaws.internal.SdkInternalList<DBSecurityGroupMembership>();
        }
        return dBSecurityGroupMemberships;
    }
414666
def getDatabases(self):
        
        cur = self._conn.cursor()
        cur.execute("""SHOW DATABASES;""")
        rows = cur.fetchall()
        if rows:
            return [row[0] for row in rows]
        else:
            return []
1350257
public List<ComponentDto> selectByKeysAndBranches(DbSession session, Map<String, String> branchesByKey) {
    Set<String> dbKeys = branchesByKey.entrySet().stream()
      .map(entry -> generateBranchKey(entry.getKey(), entry.getValue()))
      .collect(toSet());
    return selectByDbKeys(session, dbKeys);
  }
924591
private DBConn createAndConnectConn(String keyspace) throws DBNotAvailableException, RuntimeException {
        DBConn dbConn = new DBConn(this, keyspace);
        connectDBConn(dbConn);
        return dbConn;
    }
507541
public java.util.List<DBSubnetGroup> getDBSubnetGroups() {
        if (dBSubnetGroups == null) {
            dBSubnetGroups = new com.amazonaws.internal.SdkInternalList<DBSubnetGroup>();
        }
        return dBSubnetGroups;
    }
1275136
private List<String> getConstraints(CmsSetupDb dbCon, String tablename) throws SQLException {

        List<String> constraints = new ArrayList<String>();
        String tableConstraints = readQuery(QUERY_SHOW_CONSTRAINTS);
        Map<String, String> replacer = new HashMap<String, String>();
        replacer.put(REPLACEMENT_TABLENAME, tablename);
        CmsSetupDBWrapper db = null;
        try {
            db = dbCon.executeSqlStatement(tableConstraints, replacer);
            while (db.getResultSet().next()) {
                String constraint = db.getResultSet().getString(FIELD_CONSTRAINT_ORACLE);
                if (!constraints.contains(constraint)) {
                    constraints.add(constraint);
                }

            }
        } finally {
            if (db != null) {
                db.close();
            }
        }

        return constraints;
    }
523346
public java.util.List<DBClusterSnapshot> getDBClusterSnapshots() {
        if (dBClusterSnapshots == null) {
            dBClusterSnapshots = new com.amazonaws.internal.SdkInternalList<DBClusterSnapshot>();
        }
        return dBClusterSnapshots;
    }