bun-types 1.2.9-canary.20250403T140620 → 1.2.9-canary.20250405T140519

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sqlite.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * ```ts
7
7
  * import { Database } from 'bun:sqlite';
8
8
  *
9
- * var db = new Database('app.db');
9
+ * const db = new Database('app.db');
10
10
  * db.query('SELECT * FROM users WHERE name = ?').all('John');
11
11
  * // => [{ id: 1, name: 'John' }]
12
12
  * ```
@@ -24,42 +24,44 @@
24
24
  * | `null` | `NULL` |
25
25
  */
26
26
  declare module "bun:sqlite" {
27
+ /**
28
+ * A SQLite3 database
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const db = new Database("mydb.sqlite");
33
+ * db.run("CREATE TABLE foo (bar TEXT)");
34
+ * db.run("INSERT INTO foo VALUES (?)", ["baz"]);
35
+ * console.log(db.query("SELECT * FROM foo").all());
36
+ * ```
37
+ *
38
+ * @example
39
+ *
40
+ * Open an in-memory database
41
+ *
42
+ * ```ts
43
+ * const db = new Database(":memory:");
44
+ * db.run("CREATE TABLE foo (bar TEXT)");
45
+ * db.run("INSERT INTO foo VALUES (?)", ["hiiiiii"]);
46
+ * console.log(db.query("SELECT * FROM foo").all());
47
+ * ```
48
+ *
49
+ * @example
50
+ *
51
+ * Open read-only
52
+ *
53
+ * ```ts
54
+ * const db = new Database("mydb.sqlite", {readonly: true});
55
+ * ```
56
+ *
57
+ * @category Database
58
+ */
27
59
  export class Database implements Disposable {
28
60
  /**
29
61
  * Open or create a SQLite3 database
30
62
  *
31
63
  * @param filename The filename of the database to open. Pass an empty string (`""`) or `":memory:"` or undefined for an in-memory database.
32
64
  * @param options defaults to `{readwrite: true, create: true}`. If a number, then it's treated as `SQLITE_OPEN_*` constant flags.
33
- *
34
- * @example
35
- *
36
- * ```ts
37
- * const db = new Database("mydb.sqlite");
38
- * db.run("CREATE TABLE foo (bar TEXT)");
39
- * db.run("INSERT INTO foo VALUES (?)", ["baz"]);
40
- * console.log(db.query("SELECT * FROM foo").all());
41
- * ```
42
- *
43
- * @example
44
- *
45
- * Open an in-memory database
46
- *
47
- * ```ts
48
- * const db = new Database(":memory:");
49
- * db.run("CREATE TABLE foo (bar TEXT)");
50
- * db.run("INSERT INTO foo VALUES (?)", ["hiiiiii"]);
51
- * console.log(db.query("SELECT * FROM foo").all());
52
- * ```
53
- *
54
- * @example
55
- *
56
- * Open read-only
57
- *
58
- * ```ts
59
- * const db = new Database("mydb.sqlite", {readonly: true});
60
- * ```
61
- *
62
- * @category Database
63
65
  */
64
66
  constructor(
65
67
  filename?: string,