Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
juninhodeluca opened this issue Mar 31, 2022 · 0 comments
Open

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

juninhodeluca opened this issue Mar 31, 2022 · 0 comments

Comments

@juninhodeluca
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant