mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-06 09:44:21 +01:00
add time querying to io trait
This commit is contained in:
@@ -92,6 +92,11 @@ impl limbo_core::IO for PlatformIO {
|
||||
let random_f64 = Math_random();
|
||||
(random_f64 * i64::MAX as f64) as i64
|
||||
}
|
||||
|
||||
fn get_current_time(&self) -> String {
|
||||
let date = Date::new();
|
||||
date.toISOString()
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
@@ -99,6 +104,17 @@ extern "C" {
|
||||
fn Math_random() -> f64;
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
type Date;
|
||||
|
||||
#[wasm_bindgen(constructor)]
|
||||
fn new() -> Date;
|
||||
|
||||
#[wasm_bindgen(method, getter)]
|
||||
fn toISOString(this: &Date) -> String;
|
||||
}
|
||||
|
||||
pub struct DatabaseStorage {
|
||||
file: Rc<dyn limbo_core::File>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user