Giter Site home page Giter Site logo

Comments (4)

griffio avatar griffio commented on June 21, 2024 2
  1. How to access to the snapshot with the solution?

change build config to https://cashapp.github.io/sqldelight/2.0.2/#snapshots using 2.1.0-SNAPSHOT

  1. Excuse me, my wrong, my type column it's timestamptz so, it's still working with DATE_TRUNC func.

Works with 2.1.0-SNAPSHOT

CREATE TABLE ProductUpdateDb(
    issue_close_date_iso TIMESTAMPTZ
);

selectDistinctLocalDate:
SELECT DISTINCT DATE_TRUNC('month', issue_close_date_iso)  AS local_date
FROM ProductUpdateDb
ORDER BY local_date DESC;
  1. This si the reason of why I currently casting the convertion to the Date type

I will create a PR to fix DATE_TRUNC as it should allow the Date type

from sqldelight.

griffio avatar griffio commented on June 21, 2024

πŸ€” There are two issues here, I think.

  1. SELECT DISTINCT was broken in 2.0.2 and is fixed in current snapshot #5172 - or go back to use version 2.0.0 for SELECT DISTINCT
  2. Using DATE_TRUNC with DATE breaks and currently only works for TIMESTAMP_TIMEZONE, TIMESTAMP types - this is incorrect the docs says that DATE is automatically cast https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC

So 2. needs an issue to fix this (unless you can use a TIMESTAMP)

"date_trunc" -> encapsulatingType(exprList, TIMESTAMP_TIMEZONE, TIMESTAMP)

from sqldelight.

Angel-Ponce avatar Angel-Ponce commented on June 21, 2024

πŸ€” There are two issues here, I think.

  1. SELECT DISTINCT was broken in 2.0.2 and is fixed in current snapshot SELECT DISTINCT syntax no longer worksΒ #5172 - or go back to use version 2.0.0 for SELECT DISTINCT
  2. Using DATE_TRUNC with DATE breaks and currently only works for TIMESTAMP_TIMEZONE, TIMESTAMP types - this is incorrect the docs says that DATE is automatically cast https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC

So 2. needs an issue to fix this (unless you can use a TIMESTAMP)

"date_trunc" -> encapsulatingType(exprList, TIMESTAMP_TIMEZONE, TIMESTAMP)

  1. How to access to the snapshot with the solution?

  2. Excuse me, my wrong, my type column it's timestamptz so, it's still working with DATE_TRUNC func.

  3. This si the reason of why I currently casting the convertion to the Date type

from sqldelight.

Angel-Ponce avatar Angel-Ponce commented on June 21, 2024

πŸ€” I will try with the snapshot recommended, thank you so much for the quickly answers.

from sqldelight.

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.