Skip to content

Stability and versioning

Before you upgrade, you need to know which changes can break your code. slate follows Semantic Versioning, so the version number tells you. This page first defines the public API that the guarantees cover. It then says what each kind of release can change, and ends with how to upgrade.

The following modules make up the supported public API:

ModulePurpose
slateShared types (DetsError, FileErrorContext, AccessMode, RepairPolicy, TableInfo) and helper functions (error_code, error_message, is_dets_file)
slate/setSet tables with one value per key
slate/bagBag tables with multiple distinct values per key
slate/duplicate_bagDuplicate bag tables that allow duplicate entries
slate/exclusiveAcquisition waits, session errors, and safe classifiers

Semantic Versioning covers all public functions and types in these modules.

Everything outside those modules is internal. This includes the Erlang FFI files and the native lock implementation. They are not part of the public API and may change in any release without notice. Use the Gleam modules instead of calling FFI functions directly.

Release typeWhat changes
Patch (for example, 2.0.0 to 2.0.1)Bug fixes only. No new features or breaking changes.
Minor (for example, 2.0.0 to 2.1.0)Compatible additions, such as new functions. Existing code continues to compile and work.
Major (for example, 1.0.0 to 2.0.0)Breaking changes, such as renamed functions, changed return types, added or removed type variants, or new record fields.

The strings returned by slate.error_code and exclusive.error_code are stable across minor and patch releases. Use them for programmatic matching, logging, or metrics.

case slate.error_code(error) {
"not_found" -> handle_missing()
"access_denied" -> handle_permission_error()
code -> log_unexpected(code)
}

slate.error_message returns human-readable descriptions for display or logging. exclusive.error_message follows the same rule. These strings may change in any release. Do not use them for programmatic matching.

Error codes are stable, but some text inside error values is not. UnexpectedError(detail) contains an unexpected Erlang error as a formatted string. FileErrorContext.reason contains a diagnostic reason from OTP. Neither string is a stable API. Both may change in any release.

Use error variants or error_code for programmatic matching. error_message returns a generic message for UnexpectedError and omits file-error context. Paths and diagnostic reasons may contain sensitive data. Keep them in trusted logs.

Before a major upgrade, read the changelog for migration notes and breaking changes. Minor and patch upgrades preserve compatibility.

For 2.0, also update file-error constructors and with_table calls.

In 2.0, TableInfo includes file_path: String. The info() functions in all three table modules return the normalized absolute path, file size, and entry count. Existing field access remains valid. Update constructor calls and full constructor patterns:

Before:

let slate.TableInfo(file_size, object_count) = info
let copy = slate.TableInfo(file_size:, object_count:)

After:

let slate.TableInfo(file_size, object_count, file_path) = info
let copy = slate.TableInfo(file_size:, object_count:, file_path:)

If you only need selected fields, use a partial pattern such as let slate.TableInfo(object_count:, ..) = info.

info() remains fallible and returns TableDoesNotExist when the table is no longer open. Other stored entries need no migration for this change. If your application stores TableInfo records as data, migrate those records to the new shape.