Skip to content

Is possible to use Postgresql Jsonb data type with Opis? #94

Description

@juninhodeluca

Ciao!
I have refactoring some old scripts and migrating native PDO queries to Opis.
At some point I found a query which looks like that (reduced version to explain):

SELECT c.column1, c.json::jsonb AS raw_data FROM table c

Since I coudn't find onto documentation, I have tryed to do

$this->db->from( [ 'table' => 'c' ])
                ->select( function ($include ) {
                    $include
                        ->column( 'c.column1' )
                        ->column( 'c.json::jsonb', 'raw_data' );
                } )
                ->all();

But, not worked, ofc, otherwise I wouldn't be here asking a help hehe
Thank you in advice

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions