Closed TomMettam closed 1 year ago
You need to provide an alias for the selection using the as
method.
.select([
'foo',
'bar',
sql<number>`UNIX_TIMESTAMP(slotWeeks.startDate)`.as('slotWeekStart')
])
From the select
method's documentation:
I'm trying to figure out how to accomplish something like
SELECT UNIX_TIMESTAMP(slotWeeks.startDate) as slotWeekStart
I tried using an sql template but it seems not to be accepted by .select()
What's the way to accomplish this in Kysely?