mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-31 13:54:27 +01:00
serverless: Improve pragma() after close() error
This commit is contained in:
@@ -94,6 +94,9 @@ export class Connection {
|
||||
* @returns Promise resolving to the result of the pragma
|
||||
*/
|
||||
async pragma(pragma: string): Promise<any> {
|
||||
if (!this.isOpen) {
|
||||
throw new TypeError("The database connection is not open");
|
||||
}
|
||||
const sql = `PRAGMA ${pragma}`;
|
||||
return this.session.execute(sql);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user