Files
bun.sh/src/sql/mysql.zig
Ciro Spaciari beea7180f3 refactor(MySQL) (#22619)
### What does this PR do?

### How did you verify your code works?

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-13 14:52:19 -07:00

29 lines
1.1 KiB
Zig

pub fn createBinding(globalObject: *jsc.JSGlobalObject) JSValue {
const binding = JSValue.createEmptyObjectWithNullPrototype(globalObject);
binding.put(globalObject, ZigString.static("MySQLConnection"), MySQLConnection.js.getConstructor(globalObject));
binding.put(globalObject, ZigString.static("init"), jsc.JSFunction.create(globalObject, "init", MySQLContext.init, 0, .{}));
binding.put(
globalObject,
ZigString.static("createQuery"),
jsc.JSFunction.create(globalObject, "createQuery", MySQLQuery.createInstance, 6, .{}),
);
binding.put(
globalObject,
ZigString.static("createConnection"),
jsc.JSFunction.create(globalObject, "createConnection", MySQLConnection.createInstance, 2, .{}),
);
return binding;
}
pub const MySQLConnection = @import("./mysql/js/JSMySQLConnection.zig");
pub const MySQLContext = @import("./mysql/MySQLContext.zig");
pub const MySQLQuery = @import("./mysql/js/JSMySQLQuery.zig");
const bun = @import("bun");
const jsc = bun.jsc;
const JSValue = jsc.JSValue;
const ZigString = jsc.ZigString;