mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-21 17:14:19 +01:00
Update getrandom dependency in ext api crate
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1711,7 +1711,7 @@ name = "limbo_ext"
|
||||
version = "0.0.16"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"getrandom 0.2.15",
|
||||
"getrandom 0.3.1",
|
||||
"limbo_macros",
|
||||
]
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ core_only = []
|
||||
static = []
|
||||
|
||||
[dependencies]
|
||||
chrono = "0.4.40"
|
||||
getrandom = { version = "0.2.15", features = ["js"] }
|
||||
limbo_macros = { workspace = true }
|
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dependencies]
|
||||
getrandom = "0.3.1"
|
||||
chrono = "0.4.40"
|
||||
|
||||
@@ -59,9 +59,14 @@ register_extension!{
|
||||
scalars: { double }, // name of your function, if different from attribute name
|
||||
aggregates: { Percentile },
|
||||
vtabs: { CsvVTable },
|
||||
vfs: { ExampleFS },
|
||||
}
|
||||
```
|
||||
|
||||
**NOTE**: Currently, any Derive macro used from this crate is required to be in the same
|
||||
file as the `register_extension` macro.
|
||||
|
||||
|
||||
### Scalar Example:
|
||||
```rust
|
||||
use limbo_ext::{register_extension, Value, scalar};
|
||||
|
||||
@@ -14,7 +14,7 @@ pub trait VfsExtension: Default + Send + Sync {
|
||||
}
|
||||
fn generate_random_number(&self) -> i64 {
|
||||
let mut buf = [0u8; 8];
|
||||
getrandom::getrandom(&mut buf).unwrap();
|
||||
getrandom::fill(&mut buf).unwrap();
|
||||
i64::from_ne_bytes(buf)
|
||||
}
|
||||
fn get_current_time(&self) -> String {
|
||||
|
||||
Reference in New Issue
Block a user