I'm writing a Sinatra API using Sequel, but I don't know how to translate some of my postgres queries into Sequel. My table has a date column and I want to graph records grouped by year-month, so I have the following SQL:
year_months_sql = "select distinct to_char(date, 'YYYY-MM') as year_month
from receipts
where date >= ?
order by year_month asc"
This is one of a few queries that uses this to_char(date, 'YYYY-MM'). I can't find anything on Sequel docs about this.