Fix JavaScript API reference

This commit is contained in:
Pekka Enberg
2025-08-18 14:00:46 +03:00
committed by GitHub
parent 3ee2be6750
commit 33ddae1877

View File

@@ -7,15 +7,11 @@ This document describes the JavaScript API for Turso. The API is implemented in
The API is compatible with the libSQL promise API, which is an asynchronous variant of the `better-sqlite3` API.
## class Database
## Functions
The `Database` class represents a connection that can prepare and execute SQL statements.
#### connect(path, [options]) ⇒ Database
### Methods
#### new Database(path, [options]) ⇒ Database
Creates a new database connection.
Opens a new database connection.
| Param | Type | Description |
| ------- | ------------------- | ------------------------- |
@@ -26,6 +22,12 @@ To open an in-memory database, please pass `:memory:` as the `path` parameter.
The function returns a `Database` object.
## class Database
The `Database` class represents a connection that can prepare and execute SQL statements.
### Methods
#### prepare(sql) ⇒ Statement
Prepares a SQL statement for execution.