Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
strategy:
fail-fast: true
matrix:
otp: ["28.1.1"]
elixir: ["1.19.2-otp-28"]
otp: ["28.5"]
elixir: ["1.19.4-otp-28"]
zig: ["0.14.1"]
steps:
- name: Clone the repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
Expand Down Expand Up @@ -94,8 +94,8 @@ jobs:
otp: "27.3.4.5"
elixir: "1.19.2-otp-27"
- os: ubuntu-24.04
otp: "28.1.1"
elixir: "1.19.2-otp-28"
otp: "28.5"
elixir: "1.19.4-otp-28"
- os: macos-14
# These actually are not relevant since brew just pulls the latest version
otp: "latest"
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [0.17.0] - 2026-05-08

### Changed

- Update TigerBeetle client to 0.17.0

### Breaking Changes

- `create_accounts/2` and `create_transfers/2` now return one result per submitted event, using
`CreateAccountResult` and `CreateTransferResult` with `status` and `timestamp` fields.
- Remove the old sparse `CreateAccountsResult` and `CreateTransfersResult` structs in favor of the
new per-event result API and `CreateAccountStatus` / `CreateTransferStatus` enums.

## [0.16.78] - 2026-03-25

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The package can be installed by adding `tigerbeetlex` to your list of dependenci
```elixir
def deps do
[
{:tigerbeetlex, "~> 0.16.78"}
{:tigerbeetlex, "~> 0.17.0"}
]
end
```
Expand Down
32 changes: 21 additions & 11 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ fn resolve_target(b: *std.Build, target_requested: ?[]const u8) !std.Build.Resol
return b.resolveTargetQuery(query);
}

fn dependency_root_path(b: *std.Build, name: []const u8) std.Build.LazyPath {
const deps = @import("root").dependencies;
const pkg_hash = for (b.available_deps) |dep| {
if (std.mem.eql(u8, dep[0], name)) break dep[1];
} else std.debug.panic("no dependency named '{s}' in build.zig.zon", .{name});

inline for (@typeInfo(deps.packages).@"struct".decls) |decl| {
if (std.mem.eql(u8, decl.name, pkg_hash)) {
return .{ .cwd_relative = @field(deps.packages, decl.name).build_root };
}
}

unreachable;
}

// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
// runner.
Expand Down Expand Up @@ -64,18 +79,13 @@ pub fn build(b: *std.Build) !void {
break :blk b.run(&argv);
};

// In its build.zig, TigerBeetle accepts a git commit hash that gets passed around to different modules (CI, VSR etc).
// If no one is explicitly passed, it falls back to reading it by shelling out to git.
// This is a problem because it means that it's a compile-time requirement to build inside a git repo, which could be
// false if we're using TigerBeetlex, e.g., in an .exs script.
// To avoid this, we just pass a fake git commit hash, since the git commit hash doesn't change the client behavior
// in any way.
const fake_git_commit_hash = "bee71e0000000000000000000000000000bee71e"; // Beetle-hash!
const tigerbeetle_dep = b.dependency("tigerbeetle", .{ .@"git-commit" = @as([]const u8, fake_git_commit_hash) });

const stdx_mod = b.createModule(.{ .root_source_file = tigerbeetle_dep.path("src/stdx/stdx.zig") });
// We only need TigerBeetle's source files. Running its build.zig would shell out to git while
// configuring unrelated release/test steps, which fails when TigerBeetlex is built from a
// non-git directory such as a Hex dependency checkout.
const tigerbeetle_root = dependency_root_path(b, "tigerbeetle");
const stdx_mod = b.createModule(.{ .root_source_file = tigerbeetle_root.path(b, "src/stdx/stdx.zig") });
const vsr_mod = b.createModule(.{
.root_source_file = tigerbeetle_dep.path("src/vsr.zig"),
.root_source_file = tigerbeetle_root.path(b, "src/vsr.zig"),
});
vsr_mod.addImport("stdx", stdx_mod);

Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
// internet connectivity.
.dependencies = .{
.tigerbeetle = .{
.url = "https://github.com/tigerbeetle/tigerbeetle/archive/refs/tags/0.16.78.tar.gz",
.hash = "N-V-__8AAA44hQBJEzstrDbqwqyEfsRaqLUt2Dn1iCPUdAe0",
.url = "https://github.com/tigerbeetle/tigerbeetle/archive/refs/tags/0.17.0.tar.gz",
.hash = "N-V-__8AAFAChwA75k5_3tJ2WE-plkwNlyHjSj2KAtEGpwkt",
},
},
.paths = .{
Expand Down
6 changes: 3 additions & 3 deletions guides/change_data_capture.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```elixir
Mix.install([
{:tigerbeetlex, "~> 0.16.78"},
{:tigerbeetlex, "~> 0.17.0"},
{:broadway, "~> 1.2"},
{:broadway_rabbitmq, "~> 0.7"},
{:jason, "~> 1.2"}
Expand Down Expand Up @@ -35,7 +35,7 @@ In your `mix.exs` add TigerBeetlex, Broadway and Jason as dependencies

```elixir
[
{:tigerbeetlex, "~> 0.16.78"},
{:tigerbeetlex, "~> 0.17.0"},
{:broadway, "~> 1.2"},
{:broadway_rabbitmq, "~> 0.7"},
{:jason, "~> 1.2"}
Expand Down Expand Up @@ -171,7 +171,7 @@ account_2 =
code: 3
}

{:ok, _account_errors} = Connection.create_accounts(:tb, [account_1, account_2])
{:ok, _account_results} = Connection.create_accounts(:tb, [account_1, account_2])
# Error handling omitted
```

Expand Down
Loading
Loading