mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-07 10:14:21 +01:00
throw on empty statement
This commit is contained in:
@@ -77,6 +77,10 @@ class Database {
|
||||
* @param {string} sql - The SQL statement string to prepare.
|
||||
*/
|
||||
prepare(sql) {
|
||||
if (!sql) {
|
||||
throw new RangeError('The supplied SQL string contains no statements');
|
||||
}
|
||||
|
||||
try {
|
||||
return new Statement(this.db.prepare(sql), this);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user