简体   繁体   中英

List of supported dbms values

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM