use a string in SELECT clause on knex js (postgres)
<p>Hi I would like to include a string value to SELECT clause on KnexJS. It worked fine on Postgresql, but I am not sure how to convert that query into Knex syntax.</p>

<p>Here is Postgresql:</p>

<pre><code>select date, 'UNFINISHED' from task_history
where store_id=1 and date=20160527
</code></pre>

<p>Here is Knex:</p>

<pre><code>await db.table('task_history')
.count('*')
.select('date', knex.raw("UNFINISHED"))
.where({ 
     store_id: request.params.storeid,
     finish_time: null 
}) 
.whereBetween('date', [request.params.sdate, request.params.edate])                    
.groupBy('date')
</code></pre>

<p>Knex one gives me an error saying that there is no column called UNFINISHED. "UNFINISHED" is a string value that I would like to return with the query result.</p>

<p>I've tried to use knex.raw() as mentioned first solution below, but somehow, I could not use knex.raw(). Maybe that's because of 'await'? I am not sure.</p>

<p>Update: .select('date', db.raw("'UNFINISHED'")) Just a single quote missing.</p>