mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-30 06:24:21 +01:00
bind/js: Add missing methods for Database and Statement
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user