Skip to content

Commit

Permalink
docs: add info about CqlDecimal
Browse files Browse the repository at this point in the history
  • Loading branch information
muzarski committed Jan 31, 2024
1 parent 9afefa0 commit 9e7cdd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/data-types/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Database types and their Rust equivalents:
* `Time` <----> `value::CqlTime`, `chrono::NaiveTime`, `time::Time`
* `Timestamp` <----> `value::CqlTimestamp`, `chrono::DateTime<Utc>`, `time::OffsetDateTime`
* `Duration` <----> `value::CqlDuration`
* `Decimal` <----> `bigdecimal::Decimal`
* `Decimal` <----> `value::CqlDecimal`, `bigdecimal::Decimal`
* `Varint` <----> `value::CqlVarint`, `num_bigint::BigInt` (v0.3 and v0.4)
* `List` <----> `Vec<T>`
* `Set` <----> `Vec<T>`
Expand Down
11 changes: 10 additions & 1 deletion docs/source/data-types/decimal.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Decimal
`Decimal` is represented as [`bigdecimal::BigDecimal`](https://docs.rs/bigdecimal/0.2.0/bigdecimal/struct.BigDecimal.html)
`Decimal` is represented as `value::CqlDecimal` or [`bigdecimal::BigDecimal`](https://docs.rs/bigdecimal/latest/bigdecimal/struct.BigDecimal.html)

## bigdecimal::BigDecimal

To make use of `bigdecimal::Bigdecimal` type, user should enable `bigdecimal-04` crate feature.

## value::CqlDecimal

Without any feature flags, the user can interact with `decimal` type by making use of `value::CqlDecimal` which
is a very simple wrapper representing the value as signed binary number in big-endian order with a 64-bit scale.

```rust
# extern crate scylla;
Expand Down

0 comments on commit 9e7cdd1

Please sign in to comment.