mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
bun:sqlite (#167)
* ✂️
* Add the slow version
* draw the rest of the owl
* Fix crash when allocating lots of memory
* [Bun.Transipiler] Support passing objects
* [JS Parser] Support passing objects to macros via Bun.Transpiler
* Update JSSQLStatement.cpp
* Embed SQLite
* Add SQLite to Dockerfile
* [sqlite] Add quick one-off queries without creating a whole object
* [sqlite] Add `columnsCount`, rename raw() to `values()`, remove `rebind`
* Implement `bun:sqlite`
* return null
* Fix updating query
* Update bun.d.ts
* more tests
* Support variadic arguments, write tests and add types
* Update sqlite.d.ts
* Update sqlite.d.ts
* latest
* Implement `Database.loadExtension` and `Database.setCustomSQLite`
* Support `require.resolve`
* [napi] Improve string performance
* [bun.js] Support some of `node:module`
* another test
* [sqlite] Support serialize & deserialize
* [`bun:ffi`] Implement `CFunction` and `linkSymbols`
* [bun.js] Fix crash in `Buffer.from`
* Update sqlite.test.js
* Document linkSymbols
* docs
* Update README.md
This commit is contained in:
@@ -1173,6 +1173,28 @@ pub const VirtualMachine = struct {
|
||||
.hash = 0,
|
||||
};
|
||||
},
|
||||
.@"bun:sqlite" => {
|
||||
return ResolvedSource{
|
||||
.allocator = null,
|
||||
.source_code = ZigString.init(
|
||||
@as(string, @embedFile("./bindings/sqlite/sqlite.exports.js")),
|
||||
),
|
||||
.specifier = ZigString.init("bun:sqlite"),
|
||||
.source_url = ZigString.init("bun:sqlite"),
|
||||
.hash = 0,
|
||||
};
|
||||
},
|
||||
.@"node:module" => {
|
||||
return ResolvedSource{
|
||||
.allocator = null,
|
||||
.source_code = ZigString.init(
|
||||
@as(string, @embedFile("./module.exports.js")),
|
||||
),
|
||||
.specifier = ZigString.init("node:module"),
|
||||
.source_url = ZigString.init("node:module"),
|
||||
.hash = 0,
|
||||
};
|
||||
},
|
||||
}
|
||||
} else if (_specifier.len > js_ast.Macro.namespaceWithColon.len and
|
||||
strings.eqlComptimeIgnoreLen(_specifier[0..js_ast.Macro.namespaceWithColon.len], js_ast.Macro.namespaceWithColon))
|
||||
@@ -2891,6 +2913,8 @@ pub const HardcodedModule = enum {
|
||||
@"node:fs",
|
||||
@"node:path",
|
||||
@"detect-libc",
|
||||
@"bun:sqlite",
|
||||
@"node:module",
|
||||
|
||||
pub const Map = bun.ComptimeStringMap(
|
||||
HardcodedModule,
|
||||
@@ -2905,6 +2929,9 @@ pub const HardcodedModule = enum {
|
||||
.{ "node:path/win32", HardcodedModule.@"node:path" },
|
||||
.{ "node:path/posix", HardcodedModule.@"node:path" },
|
||||
.{ "detect-libc", HardcodedModule.@"detect-libc" },
|
||||
.{ "bun:sqlite", HardcodedModule.@"bun:sqlite" },
|
||||
.{ "node:module", HardcodedModule.@"node:module" },
|
||||
.{ "module", HardcodedModule.@"node:module" },
|
||||
},
|
||||
);
|
||||
pub const LinkerMap = bun.ComptimeStringMap(
|
||||
@@ -2919,6 +2946,9 @@ pub const HardcodedModule = enum {
|
||||
.{ "node:path", "node:path" },
|
||||
.{ "path", "node:path" },
|
||||
.{ "bun:wrap", "bun:wrap" },
|
||||
.{ "bun:sqlite", "bun:sqlite" },
|
||||
.{ "node:module", "node:module" },
|
||||
.{ "module", "node:module" },
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user