Compare commits

..

2 commits

2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ const std = @import("std");
/// Simple ModelFromSql and ModelToSql functions for models which have the same table definition.
pub fn TableModel(comptime Model: type, comptime TableShape: type) type {
// Get fields of the model, which must be the same as the table shape.
const fields = std.meta.fields(Model);
const fields = std.meta.fields(TableShape);
return struct {
/// Simply copy all fields from model to table.

View file

@ -61,7 +61,7 @@ pub fn TableWithRelations(comptime TableShape: type, comptime MetadataShape: ?ty
.Struct = .{
.layout = tableType.Struct.layout,
.fields = &fields,
.decls = tableType.Struct.decls,
.decls = &[0]std.builtin.Type.Declaration{},
.is_tuple = tableType.Struct.is_tuple,
.backing_integer = tableType.Struct.backing_integer,
},