mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
refactor(postgres) improve postgres code base (#20808)
Co-authored-by: cirospaciari <6379399+cirospaciari@users.noreply.github.com>
This commit is contained in:
18
src/sql/postgres/protocol/ReadyForQuery.zig
Normal file
18
src/sql/postgres/protocol/ReadyForQuery.zig
Normal file
@@ -0,0 +1,18 @@
|
||||
const ReadyForQuery = @This();
|
||||
status: TransactionStatusIndicator = .I,
|
||||
pub fn decodeInternal(this: *@This(), comptime Container: type, reader: NewReader(Container)) !void {
|
||||
const length = try reader.length();
|
||||
bun.assert(length >= 4);
|
||||
|
||||
const status = try reader.int(u8);
|
||||
this.* = .{
|
||||
.status = @enumFromInt(status),
|
||||
};
|
||||
}
|
||||
|
||||
pub const decode = DecoderWrap(ReadyForQuery, decodeInternal).decode;
|
||||
|
||||
const DecoderWrap = @import("./DecoderWrap.zig").DecoderWrap;
|
||||
const NewReader = @import("./NewReader.zig").NewReader;
|
||||
const TransactionStatusIndicator = @import("./TransactionStatusIndicator.zig").TransactionStatusIndicator;
|
||||
const bun = @import("bun");
|
||||
Reference in New Issue
Block a user