Skip to content
Date/time integration for cl-postgres that uses LOCAL-TIME for types that use time zones and SIMPLE-DATE for those that don't
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
cl-postgres-datetime.asd
cl-postgres-datetime.lisp

README.md

cl-postgres-datetime

cl-postgres-datetime provides date/time integration for cl-postgres.

It uses local-time for types that use time zones (i.e. timestamptz) and simple-date for types that don't (i.e. timestamp, date, time, interval).

Why?

Neither local-time nor simple-date alone work well with all the date/time types that Postgres supports.

local-time's TIMESTAMP is a natural fit for timestamptz, and while non-timezone types like timestamp and date could be parsed into it, the user has to remember to always use +UTC-ZONE+ when decoding such a timestamp (the values of decoded components may mismatch with the original if the default time zone were different from UTC).

simple-date has no concept of time zones, so while it works well for every type that doesn't need a timezone, it fails badly when it comes to timestamptz.

Installation

As of now, the library is not available in Quicklisp, so you will need to clone the repository and load it manually.

Usage

Once the library is loaded in your image, just use update-sql-readtable to update the readtable in cl-postgres.

(setf cl-postgres:*sql-readtable* (cl-postgres-datetime:update-sql-readtable cl-postgres:*sql-readtable*))
You can’t perform that action at this time.