November 30, 2022
Skeema v1.9.0 has been released! This new version includes support for environment variables in option files, temp-schema workspace offloading in Premium CLI, improved ignore regex options, and support for this month’s new MariaDB releases including MariaDB 10.10.
Env vars in option files
Skeema v1.9.0 introduces the ability to use environment variables in
.skeema option files for some connectivity-related options: user, password, host, schema, and more. This functionality provides a powerful mechanism for dynamic configuration.
For example, if the line
user=$SKEEMA_USER appears in a
.skeema option file, the user option will dynamically take on whatever value the
$SKEEMA_USER environment variable is set to.
This functionality is especially useful when running Skeema against multiple databaser servers that have different passwords. For example,
maindb/.skeema could contain
otherdb/.skeema could contain
You can also leverage Skeema’s support for environment sections in config files, for example:
[production] host=$PROD_HOST user=$PROD_USER password=$PROD_PW [staging] host=$STAGING_HOST user=$STAGING_USER password=$STAGING_PW
This allows you to use different env variables among production, staging, development, and so forth.
Temp-schema workspace offloading
Skeema executes the
CREATE statements from your *.sql files in a temporary location, called a workspace. By default, this is a temporary database called
_skeema_tmp on each server that Skeema interacts with. This can be undesirable on extremely large and busy databases though, so Skeema has also long supported use of ephemeral Docker containers as an alternative workspace location. However, use of Docker can be tricky when running
skeema itself from a container, so additional flexibility has often been requested by some of the largest Skeema users.
To solve this problem, Skeema v1.9.0 introduces a new Premium Edition option, temp-schema-environment, which provides a way to specify a separate database server for offloading workspaces. The option value is set to the name of an environment (
.skeema file section) which can override some or all connectivity options (host, port, socket, user, password, SSH options, SSL options, etc) for determining what host to place the temp-schema workspace on. For example, consider this
.skeema file snippet:
[production] host=db-prod.example.com user=produser temp-schema-environment=staging [staging] host=db-stage.example.com user=stageuser
With the above configuration,
skeema operations on the production environment will place their temp-schema workspace on the staging server – a reasonable choice, especially since staging environments tend to mirror production configuration closely. Other good choices may be a dedicated DB server environment just for workspaces, to completely isolate the workspace impact from other environments; or perhaps a dev environment on localhost (on whichever servers run
skeema), to remove network latency and speed up the operation.
ignore regex options
Previously, the Community edition of Skeema only supported the ability to ignore tables and entire databases. With v1.9.0, the ignore-proc and ignore-func options have been brought to the Community edition as well. These options were originally introduced in the Premium edition one year ago.
Additionally, the underlying implementation for the
ignore options has been changed, so that these options take effect earlier in the processing flow for all commands. This improves performance, and ensures that any SQL errors from an ignored statement do not affect the execution of the command in any way.
MariaDB fixes and improvements
MariaDB 10.10 is now fully supported, including special conversion logic for its new
inet4 column type. Additionally, all MariaDB 10.3-10.9 point releases from this month are now properly supported as well, fixing a compatibility problem caused by these releases' change to
SHOW CREATE TABLE output.
Furthermore, the Community edition of Skeema now supports using MariaDB’s atomic
CREATE OR REPLACE syntax when modifying an existing proc/func. This functionality was originally introduced in Skeema v1.6.0-premium one year ago, but is now present in the Community Edition as well.
For more information on Skeema v1.9.0, full release notes are available on GitHub.