Zig 0.17.0

migrating

On this page:

  • spider.migrating: Whether this run is spider migrate (SPIDER_MIGRATE set): listen() then applies the migrations and returns without serving. An app whose main() does work before listen() that migrating does not need (an identity provider, a cache) migrates first and returns:

spider.migrating

zig
pub fn migrating() bool

Whether this run is spider migrate (SPIDER_MIGRATE set): listen() then applies the migrations and returns without serving. An app whose main() does work before listen() that migrating does not need (an identity provider, a cache) migrates first and returns:

zig
try spider.pg.init(allocator, io, .{});
if (spider.migrating()) {
    var server = spider.app(.{});
    defer server.deinit();
    return server.mountModules(.{notify}).migrations(app_migrations.all).listen(.{});
}