Skip to content

Commit

Permalink
fix: missing uuid package on timeuuid example
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHe4rt committed Apr 16, 2024
1 parent 71d41a7 commit 0180bf3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/data-types/timeuuid.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Timeuuid

`Timeuuid` is represented as `value::CqlTimeuuid`.
`value::CqlTimeuuid` is a wrapper for `uuid::Uuid` with custom ordering logic
`value::CqlTimeuuid` is a wrapper for `uuid::Uuid` (using the `v1` feature) with custom ordering logic
which follows Scylla/Cassandra semantics.

```rust
# extern crate scylla;
# use scylla::Session;
# use std::error::Error;
# use std::str::FromStr;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use scylla::IntoTypedRows;
use scylla::frame::value::CqlTimeuuid;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {

// Insert some timeuuid into the table
let to_insert: CqlTimeuuid = CqlTimeuuid::from_str("8e14e760-7fa8-11eb-bc66-000000000001")?;
Expand All @@ -29,7 +29,6 @@ if let Some(rows) = session.query("SELECT a FROM keyspace.table", &[]).await?.ro
# }
```


To use the Timeuuid on `uuid` crate, enable the feature `v1` in your crate using:

```shell
Expand All @@ -39,13 +38,14 @@ cargo add uuid -F v1
and now you're gonna be able to use the `uuid::v1` features:

```rust
# extern crate uuid;
# extern crate scylla;
# use scylla::Session;
# use std::error::Error;
# use std::str::FromStr;
use scylla::IntoTypedRows;
use uuid::Uuid;
use scylla::frame::value::CqlTimeuuid;
use uuid::Uuid;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {

// Insert some timeuuid into the table
Expand Down

0 comments on commit 0180bf3

Please sign in to comment.