aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/sqlite/sqlite.exports.js
diff options
context:
space:
mode:
authorGravatar Colin McDonnell <colinmcd94@gmail.com> 2022-11-09 15:40:40 -0800
committerGravatar GitHub <noreply@github.com> 2022-11-09 15:40:40 -0800
commitf7f1b604443c030afe29d1059b90f72c69afe081 (patch)
tree8f2397447b2a84dab02850007264b72cc565f5d6 /src/bun.js/bindings/sqlite/sqlite.exports.js
parentda257336b0b70df8c31da647496899cf70670000 (diff)
downloadbun-f7f1b604443c030afe29d1059b90f72c69afe081.tar.gz
bun-f7f1b604443c030afe29d1059b90f72c69afe081.tar.zst
bun-f7f1b604443c030afe29d1059b90f72c69afe081.zip
Add bun-types, add typechecking, add `child_process` types (#1475)
* Add bun-types to packages * Improve typing * Fix types in tests * Fix dts tests * Run formatter * Fix all type errors * Add strict mode, fix type errors * Add ffi changes * Move workflows to root * Add workflows * Remove labeler * Add child_process types * Fix synthetic defaults issue * Remove docs * Move scripts * Run prettier * Include examples in typechecking * captureStackTrace types * moved captureStackTrace types to globals * Address reviews Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Diffstat (limited to 'src/bun.js/bindings/sqlite/sqlite.exports.js')
-rw-r--r--src/bun.js/bindings/sqlite/sqlite.exports.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/bun.js/bindings/sqlite/sqlite.exports.js b/src/bun.js/bindings/sqlite/sqlite.exports.js
index 6c1bf803d..875e28ff1 100644
--- a/src/bun.js/bindings/sqlite/sqlite.exports.js
+++ b/src/bun.js/bindings/sqlite/sqlite.exports.js
@@ -3,7 +3,7 @@ var symbolFor = Symbol.for;
const lazy = globalThis[symbolFor("Bun.lazy")];
if (!lazy || typeof lazy !== "function") {
throw new Error(
- "Something went wrong while loading Bun. Expected 'Bun.lazy' to be defined."
+ "Something went wrong while loading Bun. Expected 'Bun.lazy' to be defined.",
);
}
@@ -185,14 +185,14 @@ export class Database {
filenameGiven,
typeof options === "object" && options
? !!options.readonly
- : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0
+ : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0,
);
this.filename = ":memory:";
return;
}
throw new TypeError(
- `Expected 'filename' to be a string, got '${typeof filenameGiven}'`
+ `Expected 'filename' to be a string, got '${typeof filenameGiven}'`,
);
}
@@ -208,7 +208,7 @@ export class Database {
if ("readOnly" in options)
throw new TypeError(
- 'Misspelled option "readOnly" should be "readonly"'
+ 'Misspelled option "readOnly" should be "readonly"',
);
if (options.create) {
@@ -316,7 +316,7 @@ export class Database {
query(query) {
if (typeof query !== "string") {
throw new TypeError(
- `Expected 'query' to be a string, got '${typeof query}'`
+ `Expected 'query' to be a string, got '${typeof query}'`,
);
}
@@ -337,7 +337,7 @@ export class Database {
return (this.#cachedQueriesValues[index] = this.prepare(
query,
undefined,
- willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0
+ willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0,
));
}
return stmt;
@@ -349,7 +349,7 @@ export class Database {
var stmt = this.prepare(
query,
undefined,
- willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0
+ willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0,
);
if (willCache) {
@@ -413,21 +413,21 @@ const getController = (db, self) => {
(controller = {
default: Object.assign(
{ begin: db.prepare("BEGIN", undefined, 0) },
- shared
+ shared,
),
deferred: Object.assign(
{ begin: db.prepare("BEGIN DEFERRED", undefined, 0) },
- shared
+ shared,
),
immediate: Object.assign(
{ begin: db.prepare("BEGIN IMMEDIATE", undefined, 0) },
- shared
+ shared,
),
exclusive: Object.assign(
{ begin: db.prepare("BEGIN EXCLUSIVE", undefined, 0) },
- shared
+ shared,
),
- })
+ }),
);
}
return controller;
@@ -437,7 +437,7 @@ const getController = (db, self) => {
const wrapTransaction = (
fn,
db,
- { begin, commit, rollback, savepoint, release, rollbackTo }
+ { begin, commit, rollback, savepoint, release, rollbackTo },
) =>
function transaction(...args) {
let before, after, undo;