DapperLib / DapperLib/Dapper

QueryAsync<TEntity> not working on Postgres while querying for timestamptz data types

Open
#1,865 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
18.4k
Forks
3.7k
Avg merge
5h 8m
Merged PRs (30d)
1

Description

Hi,
I have a generic repository pattern using dapper on my project and I'm having an issue with a specific method.

Context:
I have a postgres database running and I'm able to query the database like this:
SELECT * FROM cms_treatmenttype WHERE created::text LIKE '2022-07-01 06:55:13%'

This query returns me the desired result:
image

When I try to use the same query (even hardcoded as shown below) with QueryAsync method it returns to me an empty result. Any other queries on QueryAsync with other "wheres" in fields with different data types besides timestamptz work fine, the issue is probably related to how dapper is handling the timestamptz data type on Postgres:

image

image

Can you please get back to mw with a suggestion or an understanding of this issue?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides no repository files or tests; start at the QueryAsync entry point and reproduce the reported PostgreSQL timestamptz query. Compare the database query with the Dapper call and establish a confirmed explanation or reproducible fix for the empty result.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, postgresql, sql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.