why I can't select column others than id, created_at and updated_at on joined table? #3286
Answered
by
tsulatsitamim
tsulatsitamim
asked this question in
Help
-
if I change select to users.* it only show id, created_at, updated_at |
Beta Was this translation helpful? Give feedback.
Answered by
tsulatsitamim
Oct 27, 2021
Replies: 3 comments 3 replies
-
I just ran a quick query and works as expected? const order = Database.from('db.customer_order as o')
.leftJoin('db.customer_account as ca', 'o.parent_id', '=', 'ca.object_id')
.select('o.order_id', 'ca.object_name')
.where('order_id', 6969) |
Beta Was this translation helpful? Give feedback.
1 reply
-
https://docs.adonisjs.com/guides/models/serializing-models#serializing-extras-object |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tsulatsitamim
-
Hey @tsulatsitamim! 👋🏻 Is there any reason you are not using relation instead of manually joining tables? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.adonisjs.com/guides/models/serializing-models#serializing-extras-object