Configure changesets to use native executors

Last updated: July 14, 2025

Liquibase decides whether to use the native executor based on the presence of the runWith attribute.

Procedure

1

In your changelog, apply runWith to each changeset you want to deploy using a native executor.

  • In Formatted SQL changelogs, you can apply runWithto any changeset.

  • In XML, YAML, and JSON changelogs, you can only apply runWith to changesets using the sql and sqlFile Change types.

For example, using sqlplus:

SQL example
--changeset myauthorname:2314 runWith:sqlplus

DECLARE l_emp_name VARCHAR2(250);
l_emp_no NUMBER;
l_salary NUMBER;

l_manager VARCHAR2(250);
BEGIN
INSERT INTO emp(emp_name,emp_no,salary,manager) VALUES('BBB',1000,25000,'AAA');

...
END;
YAML example
SQL example YAML example JSON example XML example
YAML example
databaseChangeLog:
   - changeSet:
       id: 1-yaml
       author: myauthorname
       runWith: sqlplus
       changes:
       - sqlFile:
           path: person.sql
           relativeToChangelogFile: true
JSON example
{
  "databaseChangeLog": [
    {
      "changeSet": {
        "id": "1-json",
        "author": "myauthorname",
        "runWith": "sqlplus",
        "changes": [
          {
            "sqlFile": {
              "path": "person.sql",
              "relativeToChangelogFile": "true"
            }
          }
        ]
      }
    ]
  }
}
XML example
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
  xmlns:pro="http://www.liquibase.org/xml/ns/pro"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
        http://www.liquibase.org/xml/ns/dbchangelog-ext
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
        http://www.liquibase.org/xml/ns/pro
        http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd">
  <changeSet id="2315" author="myauthorname" runWith="sqlplus">
    <sqlFile
        path="my/path/file.sql"
    ... >
    </changeSet>
  </databaseChangeLog>
2

In your command line, run a command to deploy your change, such as update.

liquibase update

When successful, Liquibase displays "Liquibase command 'update' was executed successfully."

Liquibase applies the native executor you specify in runWith during update and rollback operations. If you don't specify runWith, Liquibase uses the JDBC driver to deploy the changeset.