mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-06 01:34:21 +01:00
bindings/javascript: Add async connect() function
Let's make the API symmetric with libSQL and serverless drivers.
This commit is contained in:
@@ -399,4 +399,15 @@ class Statement {
|
||||
}
|
||||
}
|
||||
|
||||
export { Database, SqliteError }
|
||||
/**
|
||||
* Creates a new database connection asynchronously.
|
||||
*
|
||||
* @param {string} path - Path to the database file.
|
||||
* @param {Object} opts - Options for database behavior.
|
||||
* @returns {Promise<Database>} - A promise that resolves to a Database instance.
|
||||
*/
|
||||
async function connect(path: string, opts: any = {}): Promise<Database> {
|
||||
return new Database(path, opts);
|
||||
}
|
||||
|
||||
export { Database, SqliteError, connect }
|
||||
Reference in New Issue
Block a user