Skip to content

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

@juninhodeluca

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions