Flyway can be configured to execute migrations on a NoSQL database (i.e. via Java API) or it is designed only for relational databases?
There is no explicit support at this time. What you can however do is use Flyway in combination with both a relational and a NoSQL db. Flyway would then keep its metadata table in the relational DB and you would write Java migrations to migrate the NoSQL datastore.
An alternative to flyway for MongoDB migration is Monjam (https://github.com/oun/monjam). It has gradle plugin to run the migration. You can write migration in java or js script.
Related
I am creating a new Spring Boot project (https://start.spring.io/), and I am not understanding the different dependencies provided for interfacing with relational databases.
The point of confusion is "JDBC API" and "PostgresSQL Driver". My app needs to connect to a PostgreSQL database. So, which of the following are true?
JDBC API can be used to connect and operate with any relational (SQL) database (MySQL, PostgreSQL, etc.), and PostgresSQL Driver is not needed for JDBC API to work.
Both JDBC API and PostgresSQL Driver are needed for an application to connect to a PostgreSQL database.
The dependency PostgresSQL Driver includes JDBC API.
I have already googled about this, but there are only manuals of how to use them.
JDBC defines an API to connect and work with relational databases. The PostgreSQL driver is an implementation of this API for the PostgreSQL database.
You cannot use the JDBC API without an underlying driver to implement it. You could, however, use the driver directly, but drivers usually have very little guarantees about the stability of their APIs (other than what's promised by JDBC, of course), so it would probably be a poor idea.
I have an existing application which I want to extend by an embedded database. I have some experience with 'raw' derby (writing the sql statements by myself). For this application I use eclipse with maven but no additional framework for the application itself.
I have no experience with the spring framework but I came accross JPA data repositories (spring-data-jpa from org.springframework.data) which seems for me the way to go. But is it possible to use for the moment for this application only the data repositories of spring? Or will this lead to changes in the existing Code as one can not use only the data repositories alone?
I have a Java Web project with multitenancy using Hibernate, Spring and JPA. We recently implemented the architecture multitenancy but we don't know how update all the schemas of the database. Before that, when we didn't have this architecture we set in the persistence.xml the property hibernate.hbm2ddl.auto with update, but now it isn't possible because we have more than one schema. Do you have a solution?
Try using FlywayDB instead of hibernate.hbm2ddl.auto which shouldn't be used in production anyway. An incremental schema update can provide you a guarantee that the product environment can be safely updated, once you tested the incremented scripts on a QA server.
I want to see the tables of my Play! application with the H2 console, but all I see is a list of internal tables of the db engine. How can I view the tables of my application?
Log on to the JDBC URL jdbc:h2:mem:play instead. That is where the development database runs on at least on my Play instance.
Most likely, you are looking a different database. Could you verify the database URL is really jdbc:h2:~/play?
You should also consider upgrading to a more recent version of H2. The version you are using (1.3.149) is a beta version.
I'm looking for embedded db with Java API for testing purposes.
Also i need pl/sql support because we use oracle in production and migrations are written in pl/sql.
I want to test my DAO objects and i need to create db in memory in process of unit test using migration scripts.
Now we use HSQLDB but it does't support pl/sql.
Can you recommend anything?
According to the wikipedia page about PL/SQL, the databases supporting PL/SQL are Oracle and DB2:
Embedded DB2
Embedded Oracle
If these don't suit you, there's nothing else. PL/SQL is a creation of Oracle, so it's not expected to be widely spread.
You could try installing Oracle XE on your local developer workstation and Continuous Integration server. Then connect with the SYS as SYSDBA or SYSTEM user to create your schema(s) before executing your unit tests.
We use Firebird's pl/sql extensively. It has an embedded server you can access through JDBC.