mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
### What does this PR do? Add MySQL support, Refactor will be in a followup PR ### How did you verify your code works? A lot of tests --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cirospaciari <6379399+cirospaciari@users.noreply.github.com>
25 lines
677 B
Zig
25 lines
677 B
Zig
const CommandComplete = @This();
|
|
|
|
command_tag: Data = .{ .empty = {} },
|
|
|
|
pub fn deinit(this: *@This()) void {
|
|
this.command_tag.deinit();
|
|
}
|
|
|
|
pub fn decodeInternal(this: *@This(), comptime Container: type, reader: NewReader(Container)) !void {
|
|
const length = try reader.length();
|
|
bun.assert(length >= 4);
|
|
|
|
const tag = try reader.readZ();
|
|
this.* = .{
|
|
.command_tag = tag,
|
|
};
|
|
}
|
|
|
|
pub const decode = DecoderWrap(CommandComplete, decodeInternal).decode;
|
|
|
|
const bun = @import("bun");
|
|
const Data = @import("../../shared/Data.zig").Data;
|
|
const DecoderWrap = @import("./DecoderWrap.zig").DecoderWrap;
|
|
const NewReader = @import("./NewReader.zig").NewReader;
|