QueryAsync<TEntity> not working on Postgres while querying for timestamptz data types
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:

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:


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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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