Git Product home page Git Product logo

Comments (3)

asoltysik avatar asoltysik commented on May 28, 2024 1

@tpolecat Some thoughts on the open PR:

  1. In the PR I made timestamptz convert to java.time.OffsetDateTime. I believe the best type for timestamptz is in fact java.time.Instant. First of all, timestamptz doesn't actually hold the time zone/offset information so it doesn't really make sense to parse it as OffsetDateTime - the time zone there will always be the same when reading. That's also what Haskell's opaleye does, i.e. it maps timestamptz to UTCTime, which is haskell's equivalent of Instant.

  2. timetz doesn't make much sense. Quoting from postgres manual:

    The type time with time zone is defined by the SQL standard, but the definition exhibits properties which lead to questionable usefulness. In most cases, a combination of date, time, timestamp without time zone, and timestamp with time zone should provide a complete range of date/time functionality required by any application.

    Interestingly, opaleye doesn't expose timetz. I am not sure whether that's the right choice. Arguably, it's much easier to write your own codecs in skunk than in opaleye, but having it by default would still save some time for some people.

from skunk.

tpolecat avatar tpolecat commented on May 28, 2024

Ah yeah, the first one is a bug for sure. I haven't tested these so yeah if you can come up with a better way to do it, with tests, that would be great. 👍

from skunk.

tpolecat avatar tpolecat commented on May 28, 2024

With OffsetDateTime the offset is applied on write and is zero on read, which aligns with the behavior of timestamptz. That's my intent here.

I have no strong feelings about timetz's usefulness but if there's a compatible JDK type I would like to support it.

from skunk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.