diff --git a/src/fileEngine.zig b/src/fileEngine.zig index 28fd277..cddb133 100644 --- a/src/fileEngine.zig +++ b/src/fileEngine.zig @@ -403,7 +403,7 @@ pub const FileEngine = struct { // If there is no member to find, that mean we need to return all members, so let's populate additional data with all of them if (additional_data.member_to_find.items.len == 0) { - additional_data.populateWithEverything(allocator, sstruct.members) catch return FileEngineError.MemoryError; + additional_data.populateWithEverythingExceptLink(allocator, sstruct.members, sstruct.types) catch return FileEngineError.MemoryError; } // Open the dir that contain all files @@ -479,7 +479,7 @@ pub const FileEngine = struct { if (sync_context.checkStructLimit()) break; if (filter) |f| if (!f.evaluate(row)) continue; - EntityWriter.writeEntityTable( + EntityWriter.writeEntityJSON( writer, row, additional_data, diff --git a/src/stuffs/additionalData.zig b/src/stuffs/additionalData.zig index 16a08ae..a0b8ff5 100644 --- a/src/stuffs/additionalData.zig +++ b/src/stuffs/additionalData.zig @@ -1,5 +1,7 @@ const std = @import("std"); const Allocator = std.mem.Allocator; +const dtype = @import("dtype"); +const DataType = dtype.DataType; /// This is the [] part /// TODO: Include the part ".friends.comments" in "GRAB User.firends.comments {age > 10}" @@ -19,8 +21,9 @@ pub const AdditionalData = struct { self.member_to_find.deinit(); } - pub fn populateWithEverything(self: *AdditionalData, allocator: Allocator, members: [][]const u8) !void { - for (members, 0..) |member, i| { + pub fn populateWithEverythingExceptLink(self: *AdditionalData, allocator: Allocator, members: [][]const u8, dtypes: []DataType) !void { + for (members, dtypes, 0..) |member, dt, i| { + if (dt == .link or dt == .link_array) continue; try self.member_to_find.append(AdditionalDataMember.init(allocator, member, i)); } }