Dzoukr / Dapper.FSharp

Lightweight F# extension for StackOverflow Dapper with support for MSSQL, MySQL, PostgreSQL, and SQLite
MIT License
365 stars 35 forks source link

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

Open mastoj opened 1 year ago

mastoj commented 1 year ago

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

Dzoukr commented 1 year ago

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 commented 1 year ago

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

Dzoukr commented 1 year ago

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

mackwic commented 7 months ago

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

Thank you for your work

Dzoukr commented 7 months ago

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 😉)

mackwic commented 7 months ago

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.

Dzoukr commented 7 months ago

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.

travis-leith commented 7 months ago

@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.