Dont send link if not in AdditionalData
This commit is contained in:
parent
4ee79c9629
commit
c6fe428270
@ -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 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) {
|
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
|
// Open the dir that contain all files
|
||||||
@ -479,7 +479,7 @@ pub const FileEngine = struct {
|
|||||||
if (sync_context.checkStructLimit()) break;
|
if (sync_context.checkStructLimit()) break;
|
||||||
if (filter) |f| if (!f.evaluate(row)) continue;
|
if (filter) |f| if (!f.evaluate(row)) continue;
|
||||||
|
|
||||||
EntityWriter.writeEntityTable(
|
EntityWriter.writeEntityJSON(
|
||||||
writer,
|
writer,
|
||||||
row,
|
row,
|
||||||
additional_data,
|
additional_data,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
|
const dtype = @import("dtype");
|
||||||
|
const DataType = dtype.DataType;
|
||||||
|
|
||||||
/// This is the [] part
|
/// This is the [] part
|
||||||
/// TODO: Include the part ".friends.comments" in "GRAB User.firends.comments {age > 10}"
|
/// 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();
|
self.member_to_find.deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn populateWithEverything(self: *AdditionalData, allocator: Allocator, members: [][]const u8) !void {
|
pub fn populateWithEverythingExceptLink(self: *AdditionalData, allocator: Allocator, members: [][]const u8, dtypes: []DataType) !void {
|
||||||
for (members, 0..) |member, i| {
|
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));
|
try self.member_to_find.append(AdditionalDataMember.init(allocator, member, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user