mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-09 03:04:20 +01:00
bindings/javascript: Improve error when prepare() called after close()
This commit is contained in:
@@ -87,6 +87,10 @@ class Database {
|
||||
* @param {string} sql - The SQL statement string to prepare.
|
||||
*/
|
||||
prepare(sql) {
|
||||
if (!this.open) {
|
||||
throw new TypeError("The database connection is not open");
|
||||
}
|
||||
|
||||
if (!sql) {
|
||||
throw new RangeError("The supplied SQL string contains no statements");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user