bind/js: Add missing methods for Database and Statement

This commit is contained in:
Diego Reis
2025-05-08 08:46:38 -03:00
parent e4014d290f
commit 74f585d2e0

View File

@@ -63,7 +63,7 @@ impl Database {
Ok(Self {
memory,
_db: db,
conn,
conn,
name: path,
})
}
@@ -73,6 +73,65 @@ impl Database {
let stmt = self.conn.prepare(&sql).map_err(into_napi_error)?;
Ok(Statement::new(RefCell::new(stmt)))
}
#[napi]
pub fn transaction(&self) {
todo!()
}
#[napi]
pub fn pragma(&self) {
todo!()
}
#[napi]
pub fn backup(&self) {
todo!()
}
#[napi]
pub fn serialize(&self) {
todo!()
}
#[napi]
pub fn function(&self) {
todo!()
}
#[napi]
pub fn aggregate(&self) {
todo!()
}
#[napi]
pub fn table(&self) {
todo!()
}
#[napi]
pub fn load_extension(&self) {
todo!()
}
#[napi]
pub fn exec(&self) {
todo!()
}
#[napi]
pub fn close(&self) {
todo!()
}
}
// TODO: Add the (parent) 'database' property
@@ -117,6 +176,37 @@ impl Statement {
),
}
}
#[napi]
pub fn run(&self, _env: Env, _args: Vec<JsUnknown>) {
todo!()
}
#[napi]
pub fn iterate() {
todo!()
}
#[napi]
pub fn pluck() {
todo!()
}
#[napi]
pub fn expand() {
todo!()
}
#[napi]
pub fn raw() {
todo!()
}
#[napi]
pub fn columns() {
todo!()
}
#[napi]
pub fn bind() {
todo!()
}
}
fn to_js_value(env: &napi::Env, value: &limbo_core::OwnedValue) -> napi::Result<JsUnknown> {