Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sualeh Fatehi. Schema discovery tool  “grep” through your schema  Create schema diagrams  Lint your schema  Infer table relationships  Interact with.

Similar presentations


Presentation on theme: "Sualeh Fatehi. Schema discovery tool  “grep” through your schema  Create schema diagrams  Lint your schema  Infer table relationships  Interact with."— Presentation transcript:

1 Sualeh Fatehi

2 Schema discovery tool  “grep” through your schema  Create schema diagrams  Lint your schema  Infer table relationships  Interact with your database using JavaScript  Write templates to generate output http://www.schemacrawler.com 2

3  Project started about 8 years ago  Continuously maintained  Written in pure Java and pure JDBC  Open source and free  Business-friendly LGPL license  Database and operating system independent  Command-line tool  Maven and ant support  Provides a Java API for database metadata http://www.schemacrawler.com 3

4  Download and unzip  A large number of examples provided  Several database-specific versions available  Open source JDBC drivers bundled where available  Oracle and DB2 drivers need to be provided  GraphViz needed for graphing http://www.schemacrawler.com 4

5 JDBC Metadata  ResultSet  1, “YES”, or “TRUE”  Types  TABLE_TYPE: string  PROCEDURE_TYPE: integer  COLUMN_TYPE: does not exist SQL_DATA_TYPE: unused DATA_TYPE: yes! SchemaCrawler  POJO  boolean value  getType() returns an enum http://www.schemacrawler.com 5 http://www.devx.com/Java/Article/32443/1954

6 final Database database = SchemaCrawlerUtility.getDatabase(connection, options); for (final Schema schema: database.getSchemas()) { System.out.println(schema); for (final Table table: schema.getTables()) { System.out.println("o--> " + table); for (final Column column: table.getColumns()) { System.out.println(" o--> " + column + " (" + column.getType() + ")"); } http://www.schemacrawler.com 6

7  sc for help  Connection parameters - user name and password, and one of  Connection URL  Host and port  Information level  Determines amount of schema information retrieved  Determines time taken to crawl  Schemas  SchemaCrawler command http://www.schemacrawler.com 7

8  Plain text and HTML formats are available  All text formats are designed to be diff-ed  Commands  list  schema  details  count  dump  graph  script http://www.schemacrawler.com 8

9  Help and options overview  Basic schema output, in text and HTML  Count and dump  grep  Triggers  Stored procedures  Diagram  Lint http://www.schemacrawler.com 9

10 10


Download ppt "Sualeh Fatehi. Schema discovery tool  “grep” through your schema  Create schema diagrams  Lint your schema  Infer table relationships  Interact with."

Similar presentations


Ads by Google