1

In Liquibase I can set properties based on what DBMS I'm using, as mentioned here: Liquibase changeset by dbms type

For example:

<property name="val" dbms="postgresql" value="x"/>
<property name="val" dbms="h2" value="y"/>

My question is - where can I find a list of all valid/possible dbms values? In the Liquibase docs it just points to a page saying what databases are supported, but it does not give a corresponding dbms value. I know MYSQL is 'mysql', oracle is 'oracle', and so on, but where is the canonical list of values?

I searched the github repo for liquibase core, but can't find the magic class or enum that defines all these values.

Does anyone know where they are?

Ken White
  • 123,280
  • 14
  • 225
  • 444
mikeb
  • 10,578
  • 7
  • 62
  • 120

2 Answers2

1

I don't think there is a canonical list of what values are accepted. From what I can tell, it takes the value you provide for dbms and compares it to the short name for the connected database, so it isn't a list that it is being compared to.

If you are not connected to the database, you can usually find the dbms short name via the connection url or by looking for the getShortName() function in the database files. For example, to connect to AWS redshift, the url is jdbc:redshift://endpoint:port/database and the dbms value you'd set is just redshift. This can also be confirmed by looking at the Redshift extension for Liquibase. The function getShortName() returns redshift

If you are connected to the database, you can easily find out what the value is by running liquibase status and have a precondition with dbms set to some value in a changelog. For example (in XML),

  <preConditions>
    <dbms type="mongo"/>
  </preConditions>

results in Unexpected error running Liquibase: Validation Failed: 1 preconditions failed changelog_mongo.xml : DBMS Precondition failed: expected mongo, got mongodb

The expected value is the value you provide for dbms, and the got value is the connected database short name.

But to have a "list", I looked around and found the following ones listed at some point:

  • cockroachdb, db2, derby, edb, firebird, h2, hsqldb, informix, ingres, mariadb, mock, mssql, mysql, postgresql, sqlite, sybase
0

Just to add to Tylors comment:

On the liquibase main tutorial page https://docs.liquibase.com/start/tutorials/home.html there is list list of supported databases with their shortnames, which correspond to the dbms value.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 16 '23 at 15:15
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/34396425) – user16217248 May 19 '23 at 18:23