Skip to content

Commit 555ee86

Browse files
AUTO: Sync ScalarDB docs in English to docs site repo (#1058)
Co-authored-by: josh-wong <[email protected]>
1 parent 6f9e0b0 commit 555ee86

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/scalardb-cluster-dotnet-client-sdk/common-reference.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,34 @@ In the following table, you can find how types are converted:
161161
| DOUBLE | System.Double | double |
162162
| BOOLEAN | System.Boolean | bool |
163163
| BLOB | Google.Protobuf.ByteString | |
164+
| DATE | NodaTime.LocalDate | |
165+
| TIME | NodaTime.LocalTime | |
166+
| TIMESTAMP | NodaTime.LocalDateTime | |
167+
| TIMESTAMPTZ | NodaTime.Instant | |
164168

169+
:::note
170+
171+
The ScalarDB Cluster .NET Client SDK uses [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf) for `BLOB` type and [NodaTime](https://www.nuget.org/packages/NodaTime) for time-related types.
172+
173+
:::
174+
175+
:::warning
176+
177+
The precision of time-related types in .NET is greater than supported by ScalarDB. Therefore, you should be careful when saving time-related values received from external sources. The ScalarDB Cluster .NET Client SDK includes `WithScalarDbPrecision` extension methods that you can use to lower the precision of time-related values in the following manner:
178+
179+
```c#
180+
using ScalarDB.Client.Extensions;
181+
182+
// ...
183+
184+
var updatedAt = Instant.FromDateTimeUtc(DateTime.UtcNow)
185+
.WithScalarDbPrecision();
186+
187+
// using NodaTime to get current instant
188+
updatedAt = clockInstance.GetCurrentInstant()
189+
.WithScalarDbPrecision();
190+
```
191+
192+
For details about value ranges and precision in ScalarDB, see [Data-type mapping between ScalarDB and other databases](../schema-loader.mdx#data-type-mapping-between-scalardb-and-other-databases).
193+
194+
:::

0 commit comments

Comments
 (0)