// sqlite.wren foreign class Database { construct new() {} foreign open_(path, callback) foreign exec_(sql, callback) foreign query_(sql, callback) foreign close_(callback) // Opens a database at the given path. // The callback will be invoked with (err). open(path, callback) { open_(path, callback) } // Executes a SQL statement that does not return rows. // The callback will be invoked with (err). exec(sql, callback) { exec_(sql, callback) } // Executes a SQL query that returns rows. // The callback will be invoked with (err, rows). // `rows` will be a list of maps, where each map represents a row. query(sql, callback) { query_(sql, callback) } // Closes the database connection. // The callback will be invoked with (err). close(callback) { close_(callback) } }