From 6b7ff24f69abb9923ed7ed928c363d3e204ea75c Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Thu, 1 Feb 2024 11:02:37 -0800 Subject: [PATCH] cleanup/add note not to use createtable code in future --- src/createtable.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/createtable.zig b/src/createtable.zig index 7176358..3886560 100644 --- a/src/createtable.zig +++ b/src/createtable.zig @@ -1,5 +1,4 @@ const std = @import("std"); -const sqlite = @import("sqlite"); const AuthenticatedRequest = @import("AuthenticatedRequest.zig"); const Account = @import("Account.zig"); const encryption = @import("encryption.zig"); @@ -26,6 +25,11 @@ pub fn handler(request: *AuthenticatedRequest, writer: anytype) ![]const u8 { const allocator = request.allocator; const account_id = request.account_id; + // NOTE: Please do not use this as an example. Check out batchwriteitem for + // much better code, which was developed later. Most of the work in the + // handler here is to parse and validate the incoming JSON data. From + // there, the interface to the underlying data storage is handled by + // ddb.zig var parsed = try std.json.parseFromSlice(std.json.Value, allocator, request.event_data, .{}); defer parsed.deinit(); const request_params = try parseRequest(request, parsed, writer);