Support jsonb, idle_timeout, connection_timeout, max_lifetime timeouts in bun:sql. Add onopen and onclose callbacks. Fix missing "code" property appearing in errors. Add error codes for postgres. (#16045)

This commit is contained in:
Jarred Sumner
2024-12-30 13:25:01 -08:00
committed by GitHub
parent f0073bfa81
commit 76bfceae81
15 changed files with 1152 additions and 347 deletions

View File

@@ -89,6 +89,12 @@ pub fn appendZ(this: *StringBuilder, slice: string) [:0]const u8 {
return result;
}
pub fn appendStr(this: *StringBuilder, str: bun.String) string {
const slice = str.toUTF8(bun.default_allocator);
defer slice.deinit();
return this.append(slice.slice());
}
pub fn append(this: *StringBuilder, slice: string) string {
if (comptime Environment.allow_assert) {
assert(this.len <= this.cap); // didn't count everything