mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
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:
@@ -323,6 +323,12 @@ pub const String = extern struct {
|
||||
extern fn BunString__fromUTF16ToLatin1(bytes: [*]const u16, len: usize) String;
|
||||
extern fn BunString__fromLatin1Unitialized(len: usize) String;
|
||||
extern fn BunString__fromUTF16Unitialized(len: usize) String;
|
||||
extern fn BunString__toInt32(this: String) i64;
|
||||
pub fn toInt32(this: String) ?i32 {
|
||||
const val = BunString__toInt32(this);
|
||||
if (val > std.math.maxInt(i32)) return null;
|
||||
return @intCast(val);
|
||||
}
|
||||
|
||||
pub fn ascii(bytes: []const u8) String {
|
||||
return String{ .tag = .ZigString, .value = .{ .ZigString = ZigString.init(bytes) } };
|
||||
|
||||
Reference in New Issue
Block a user