Dapper.FSharp icon indicating copy to clipboard operation
Dapper.FSharp copied to clipboard

Can I query postgresql tables that have json columns in an easy way?

Open mastoj opened this issue 3 years ago • 8 comments

I think the subject summarize the question quite well. If I have a table with a jsonb column, can I map that somehow?

mastoj avatar Oct 19 '22 21:10 mastoj

Hi @mastoj, currently it's not supported to have it directly as json type. I am afraid you'd have to do some additional string -> json mapping.

Dzoukr avatar Oct 20 '22 11:10 Dzoukr

Of course, if you would find a way, that could be a very handy feature ;)

Dzoukr avatar Oct 20 '22 12:10 Dzoukr

Hi @mastoj, just FYI, there is a new version in progress where you are more than welcome to add vendor-specific syntax and features.

Dzoukr avatar Nov 04 '22 10:11 Dzoukr

Hello, what is the status of this issue ? It's not clear if v4 supports jsonb columns and how.

Thank you for your work

mackwic avatar Nov 14 '23 16:11 mackwic

Hi, there was no work on this yet, however, thanks to the separation between different providers on the syntax level, this can be added now (aka open to PR 😉)

Dzoukr avatar Nov 16 '23 09:11 Dzoukr

Great ! Would you give me broad directions on how to tackle this work ?

I would not know where to add the serialization and deserialization support.

mackwic avatar Nov 16 '23 13:11 mackwic

I think you can check how the flow of transformation from custom syntax to SQL works for other keywords - it's not actually hard. Start with extending the syntax in computation expressions. Also write some tests so you know how it should look like from developer's perspective.

Dzoukr avatar Nov 17 '23 08:11 Dzoukr

@mackwic before you do any coding, would be good to understand in more detail what you are proposing. Maybe just tell us the signatures of the new functions you would expect.

travis-leith avatar Nov 17 '23 08:11 travis-leith