From aff1545fa7726661d7be0753b7a824a00db5f419 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Sat, 18 May 2024 08:56:20 +0100 Subject: [PATCH] Add changelog entry and function doc --- CHANGELOG.md | 8 ++++++++ src/gleam/pgo.gleam | 1 + 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca06f1..1e7e6ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +- Provided functions for handling timestamp values. The `timestamp` function coerces a + `#(#(Int, Int, Int), #(Int, Int, Int))` value representing `#(#(year, month, day), #(hour, minute, second))` into + a `Value`. The `decode_timestamp` function can be used to decode a dynamic value returned from the database + as a timestamp in the same nested tuple format. + + ## v0.7.0 - 2024-04-05 - The password is now optional in the `url_config` function, defaulting to no diff --git a/src/gleam/pgo.gleam b/src/gleam/pgo.gleam index 849b7e1..bb463c6 100644 --- a/src/gleam/pgo.gleam +++ b/src/gleam/pgo.gleam @@ -159,6 +159,7 @@ pub fn text(a: String) -> Value @external(erlang, "gleam_pgo_ffi", "coerce") pub fn bytea(a: BitArray) -> Value +/// Coerce a timestamp represented as `#(#(year, month, day), #(hour, minute, second))` into a `Value`. @external(erlang, "gleam_pgo_ffi", "coerce") pub fn timestamp(a: #(#(Int, Int, Int), #(Int, Int, Int))) -> Value