Within MySQL Workbench, I currently have the following code:
USE my_db;
SELECT
transactions.created_at, price
FROM
transactions
JOIN
transactions_items ON transactions.id = transactions_items.transaction_id
JOIN
store_items ON store_items.id = transactions_items.store_item_id;
When running this in workbench, I receive created_at: price
. How can I construct a request to the database using knex syntax in order to retrieve an object like {created_at: price}
?
I attempted to utilize knex.raw()
, but it does not appear to be functioning as expected.