6

The json_array type of doctrine is saved to a postgres database > 9.2 as json datatype.

Postgres supports contains and lots of other operations on the json datatype. Is there any possibility to use the functionalities in doctrine?

Probably a custom SQLWalker is needed for that? As described here. Also a custom type supporting JSONB would be nice. As described here. This would increase the performance when querying for the json field. Or is there a custom lib that adds the json(b) functionality or is it even possibile using DQL.

3
  • I'm looking for the same thing, i found this while searching: github.com/opsway/doctrine-dbal-postgresql though it's still missing some operators. About jsonb I can tell you they are implementing the jsonb data type through an option but it's not available yet github.com/doctrine/dbal/pull/824 Commented May 20, 2015 at 10:18
  • 2
    @valepu I created a Symfony Bundle to support jsonb. github.com/boldtrn/JsonbBundle it works well Commented May 20, 2015 at 13:24
  • 1
    nice to hear, i might be using this sooner or later Commented May 20, 2015 at 14:03

1 Answer 1

7

I created a Symfony2 Bundle that supports jsonb.

Hope this helps.

https://github.com/boldtrn/JsonbBundle

Right now I prefer to use NativQueries instead of custom DQL functions to query for my jsonb fields. The custom functions are too cumbersome in my application.

Everything should be documented in the Bundle as well.

Sign up to request clarification or add additional context in comments.

1 Comment

Many thanks for creating this bundle, was going crazy for last 2 days.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.