Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion doc/api/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ added:
An exception is thrown if the database is not
open. This method is a wrapper around [`sqlite3changeset_apply()`][].

```js
```mjs
import { DatabaseSync } from 'node:sqlite';

const sourceDb = new DatabaseSync(':memory:');
const targetDb = new DatabaseSync(':memory:');

Expand Down Expand Up @@ -447,6 +449,19 @@ changes:
Closes the database connection. If the database connection is already closed
then this is a no-op.

This method is invoked automatically when the database is used with the `using`
statement:

```mjs
import { DatabaseSync } from 'node:sqlite';

{
using db = new DatabaseSync('file.db');
db.exec('CREATE TABLE t (id INTEGER)');
db.exec('INSERT INTO t VALUES (1)');
} // Database is closed automatically here
```

## Class: `Session`

<!-- YAML
Expand Down
Loading