SchemaCrawler | Free database schema discovery and comprehension tool | DB Client library
kandi X-RAY | SchemaCrawler Summary
kandi X-RAY | SchemaCrawler Summary
Free database schema discovery and comprehension tool
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Crawl the tables .
- Retrieves synonym definition .
- Print column references .
- Create table column .
- Retrieves additional table constraints .
- Traverse the catalog .
- Prints the indexes .
- Creates the foreign keys from the result set .
- Creates the index .
- Creates the procedure parameter .
SchemaCrawler Key Features
SchemaCrawler Examples and Code Snippets
Community Discussions
Trending Discussions on SchemaCrawler
QUESTION
In schemacrawler, is there an option to remove the "Generated by Schemacrawler" and "Generated on ..." labels? I've checked the documentation and failed to find this option.
...ANSWER
Answered 2021-Apr-24 at 20:46Yes - use the --no-info
command-line switch.
QUESTION
I'm currently ugrading all my projects that use Schemacrawler. The last version I used was 15.06.01 and I'm upgrading to 16.9.4. A lot of changes were done, I'm looking for the object that replace LintedCatalog.java. The aim is to get the list of lints detected during a db analaysis.
The project I'm currently working on is : https://github.com/adriens/schemacrawler-additional-command-lints-as-csv.git, if you want to have a look.
Thanks in advance
...ANSWER
Answered 2020-Sep-15 at 01:40Michèle,
Instead of code like createLintedCatalog
, you could use a lint collector.
Sualeh, SchemaCrawler
QUESTION
I'd like to be able to get columns on which the table I'm getting metadata on has constraints. In order to do that, I'd have to look up the value of the columns
field for a Constraint
(or, in my case, MutableTableConstraint
), and constraints are retrieved via table.tableConstraints
call (or, in Java, getTableConstraints()
).
However, whether the columns
list is actually populated seems to depend on SchemaRetrievalOptions
(or, more precisely, on the result of a informationSchemaViews.hasQuery(CONSTRAINT_COLUMN_USAGE)
call in method retrieveTableConstraintsColumns
in file TableConstraintRetriever.java
of the SchemaCrawler sources; informationSchemaViews
seems to be constructed from SchemaRetrievalOptions
in some way), which is constructed from the connection
parameter of the SchemaCrawlerUtility.getCatalog()
method, unlike SchemaCrawlerOptions
, which are constructed manually by the user.
SchemaRetrievalOptions depend on the particular DB that is used: if the schemacrawler-postgresql
dependency is included, the options will depend on the contents of that .jar
file; and that file has files like postgresql.information_schema/CHECK_CONSTRAINTS.sql
, etc, which is where some of the retrieval options come from.
So, the question is, is there a way for me to influence, programmatically, SchemaRetrievalOptions
, to include an option for CONSTRAINT_COLUMN_USAGE
? Apparently the command line interface of SchemaCrawler can achieve this by using a config file, but I'm using the Java API and the .jar
files corresponding to each DB dialect, and I can't really manually update the .jar
with the .sql
file containing the SELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
query that I need (I mean, for local usage I can, but not for distribution).
(SchemaCrawler version: 16.9.3)
...ANSWER
Answered 2020-Aug-11 at 21:45So, the question is, is there a way for me to influence, programmatically, SchemaRetrievalOptions, to include an option for
CONSTRAINT_COLUMN_USAGE
?
There are few ways that I can think of that you can influence how constraint columns are retrieved. Here are some ideas, in no particular order:
- If you have developed a
INFORMATION_SCHEMA
or other data dictionary view query that you think is generally useful for a given database dialect, please submit an enhancement request to the SchemaCrawler project on GitHub. - If you like, you can create your custom database plugin, bundle that in a jar, and make that jar available on SchemaCrawler's classpath.
- You can programatically build
InformationSchemaViews
. For some example code to get you started, please seeDatabaseInfoRetrieverTest.java
on how to build them, andSchemaCrawlerUtility.java
for how to use them.
Sualeh Fatehi, SchemaCrawler
QUESTION
Per this question and its comments, in order to obtain constraints (I'm particularly interested in check constraints), one must do the following:
Include a
.jar
corresponding to their DB driver of choice, like schemacrawler-postgresql or schemacrawler-sqlite.Set detail level to
detailed
(or higher), like so:
ANSWER
Answered 2020-Aug-11 at 21:21I think you are doing everything correctly. SchemaCrawler sources its information from what the JDBC driver provides, and from the database's data dictionary (or INFORMATION_SCHEMA
views). SchemaCrawler will not infer any metadata. So, in your case, if neither the MySQL JDBC driver nor the MySQL INFORMATION_SCHEMA
report constraints, SchemaCrawler will not retrieve them. In this case, if you want to find NULL
constraints, your best bet is to traverse the metadata and look for columns that are not nullable. You can build a utility method to do this, or submit an SchemaCrawler enhancement request for this utility. I do not have a good suggestion for how you can obtain check constraints if neither the JDBC driver nor the data dictionary views report them.
Sualeh Fatehi, SchemaCrawler
QUESTION
I am trying to use SchemaCrawler to extract schema information on db2 test database.
When running the schema
command with text or html format, things work as expected:
ANSWER
Answered 2020-Jul-17 at 19:36Sutandiono,
You can absolutely extract the schema metadata in JSON format for IBM DB2 and Oracle databases. Your log is not complete, so I cannot see the stacktrace right at the the end. What I can see, though, is that you have Jackson jar files on your classpath, which is good. Other than that, you can try with an additional command-line argument of --output-format json
. (Please let me know if this works.) In the next SchemaCrawler version, you will get a better error message, like this "Error: Output format not supported for command ", which will help you.
Sualeh Fatehi, SchemaCrawler
QUESTION
I'm trying to create a Java code that creates a nifi customized processor ! so in order to do that I need to use windows cmd windows and launch mvn archetype:generate
then choose the modele nifi by typing nifi
then choose the project by typing1
the I need to write the groupeId, the artifact ...
I need to do all that automatically by using a java code : I tryed this code :
...ANSWER
Answered 2020-Apr-12 at 20:55Just don't do that. The mvn command could accept all required arguments in command line so there are no interactive actions required. See the documentation on the plugin and supply parameters accordingly into single command. See http://maven.apache.org/archetype/maven-archetype-plugin/generate-mojo.html There is an example here: Specify archetype for archetype:generate on command line
QUESTION
I am working on a Rails application where I need to add some of the Foreign keys for existing columns from Rails migrations and few people working on same as well. I am adding this way:
...ANSWER
Answered 2019-Jan-31 at 19:35QUESTION
When I add this to the pom.xml:
...ANSWER
Answered 2018-Jul-27 at 02:14You are using incompatible versions of the main SchemaCrawler library and a SchemaCrawler database plugin. You do not need a plugin for MariaDB if you are connecting to Oracle. In fact, SchemaCrawler will work with most databases even without a SchemaCrawler database plugin on the classpath.
QUESTION
If we have oldDatabase and newDatabase. In newDatabase table cats was renamed to kittens and was added extra table puppies. Would SchemaCrawler be able to transfer data from oldDatabase to newDatabase, recognising new table names and if there are any extra fields, just leaving them empty?
...ANSWER
Answered 2017-Oct-18 at 00:54No. Please refer to the SchemaCrawler website for a list of features.
Sualeh Fatehi, SchemaCrawler
QUESTION
I'm using SQLite/Hibernate. Idea is to check each time app starts whether database structure is up to date. I have my existing database in "DB" folder and each time app start I'm creating up to date database in "DB/structure" folder.
I want to compare them and if my existing database is old, copy data to up to date database. Get rid of old database and move fresh one in it's place.
So far I've tried SchemaCrawler, but I was getting errors with it and couldn't figure it out.
UPDATE:
I connected with SchemaCrawler to both databases:
...ANSWER
Answered 2017-Oct-14 at 01:38Alyona,
Please take a look at schemacrawler-diff for ideas on how to get started with programatically comparing database structures. Please note that this code is not production ready, nor is it supported, so you will to develop your own method of comparing databases, based on your needs.
Sualeh Fatehi, SchemaCrawler
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SchemaCrawler
You can use SchemaCrawler like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the SchemaCrawler component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page