mirror of
https://github.com/jetzig-framework/jetzig.git
synced 2025-05-14 22:16:08 +00:00
Fix database launch message
When an environment variable configures the database name we connect to, we need to wrap the field access in a comptime check even if the `orelse` block never runs.
This commit is contained in:
parent
be3ca8d5cb
commit
2cff123de7
@ -272,8 +272,13 @@ pub fn init(parent_allocator: std.mem.Allocator, env_options: EnvironmentOptions
|
||||
.{
|
||||
@tagName(jetzig.database.adapter),
|
||||
switch (jetzig.environment) {
|
||||
inline else => |tag| vars.get("JETQUERY_DATABASE") orelse
|
||||
@field(jetzig.jetquery.config.database, @tagName(tag)).database,
|
||||
inline else => |tag| vars.get("JETQUERY_DATABASE") orelse blk: {
|
||||
const config = @field(jetzig.jetquery.config.database, @tagName(tag));
|
||||
break :blk if (comptime @hasField(@TypeOf(config), "database"))
|
||||
config.database
|
||||
else
|
||||
"[no database]";
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user