Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
123456789101112131415161718192021222324//! write endpoint response.
const std = @import("std");const json = std.json;
pub const Response = struct { rows_affected: u64 = 0, rows_upserted: ?u64 = null, rows_patched: ?u64 = null, rows_deleted: ?u64 = null, /// a filter-based operation hit its per-request cap and left rows behind. rows_remaining: ?bool = null,};
test "parses a write response" { const parsed = try json.parseFromSlice(Response, std.testing.allocator, \\{"status":"OK","rows_affected":3,"rows_upserted":3,"billing":{"billable_logical_bytes_written":4096},"performance":{"server_total_ms":9}} , .{ .ignore_unknown_fields = true }); defer parsed.deinit(); try std.testing.expectEqual(@as(u64, 3), parsed.value.rows_affected); try std.testing.expectEqual(@as(u64, 3), parsed.value.rows_upserted.?); try std.testing.expectEqual(@as(?u64, null), parsed.value.rows_deleted);}