Search code examples
schemacrawler

SchemaCrawler user name and roles


I am using schema crawler in my project. Is there any way to get the Users and their roles ? There catalogue object doesn't contain any such information .

I am using this configuration :

val schemaCrawlerOptions = SchemaCrawlerOptionsBuilder
  .builder
  .withSchemaInfoLevel(SchemaInfoLevelBuilder.maximum())
  .toOptions

Solution

  • SchemaCrawler does not provide a way to obtain users and roles as part of the database metadata catalog. However, you can execute any arbitrary SQL queries, and show the results in SchemaCrawler output. Depending on your database, you may be able to obtain user and role information by means of a SQL query, so then you can include this as part of the SchemaCrawler output. See the SchemaCrawler examples (included with the download) for an idea how to run SQL queries with SchemaCrawler.

    Sualeh Fatehi, SchemaCrawler.