Skip to content

Commit

Permalink
docs: update info about varint native data type
Browse files Browse the repository at this point in the history
  • Loading branch information
muzarski committed Jan 19, 2024
1 parent c72bcf6 commit de113e3
Show file tree
Hide file tree
Showing 2 changed files with 13 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:
* `Timestamp` <----> `value::CqlTimestamp`, `chrono::DateTime<Utc>`, `time::OffsetDateTime`
* `Duration` <----> `value::CqlDuration`
* `Decimal` <----> `bigdecimal::Decimal`
* `Varint` <----> `num_bigint::BigInt`
* `Varint` <----> `value::CqlVarint`, `num_bigint::BigInt` (v0.3 and v0.4)
* `List` <----> `Vec<T>`
* `Set` <----> `Vec<T>`
* `Map` <----> `std::collections::HashMap<K, V>`
Expand Down
13 changes: 12 additions & 1 deletion docs/source/data-types/varint.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Varint
`Varint` is represented as [`num_bigint::BigInt`](https://docs.rs/num-bigint/0.4.0/num_bigint/struct.BigInt.html)
`Varint` is represented as `value::CqlVarint` or [`num_bigint::BigInt`](https://docs.rs/num-bigint/0.4.0/num_bigint/struct.BigInt.html).

## num_bigint::BigInt

To make use of `num_bigint::BigInt` type, user should enable one of the available feature flags (`num-bigint-03` or `num-bigint-04`). They enable support for `num_bigint::BigInt` v0.3 and v0.4 accordingly.

## value::CqlVarint

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

## Example

```rust
# extern crate scylla;
Expand Down

0 comments on commit de113e3

Please sign in to comment.