mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
refactor(postgres) improve postgres code base (#20808)
Co-authored-by: cirospaciari <6379399+cirospaciari@users.noreply.github.com>
This commit is contained in:
23
src/sql/postgres/SocketMonitor.zig
Normal file
23
src/sql/postgres/SocketMonitor.zig
Normal file
@@ -0,0 +1,23 @@
|
||||
pub fn write(data: []const u8) void {
|
||||
if (comptime bun.Environment.isDebug) {
|
||||
DebugSocketMonitorWriter.check.call();
|
||||
if (DebugSocketMonitorWriter.enabled) {
|
||||
DebugSocketMonitorWriter.write(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn read(data: []const u8) void {
|
||||
if (comptime bun.Environment.isDebug) {
|
||||
DebugSocketMonitorReader.check.call();
|
||||
if (DebugSocketMonitorReader.enabled) {
|
||||
DebugSocketMonitorReader.write(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @sortImports
|
||||
|
||||
const DebugSocketMonitorReader = @import("./DebugSocketMonitorReader.zig");
|
||||
const DebugSocketMonitorWriter = @import("./DebugSocketMonitorWriter.zig");
|
||||
const bun = @import("bun");
|
||||
Reference in New Issue
Block a user