Friday, 26 May 2017

How can I use hasColumn with where clause in knex

With knex,I have this query:

this.knex(this.table)
            .where(this.column_data, data)
            .where("archive", 1)

I want to check if this.table has a column named 'archive', so I should use the 'hasColumn' method

How use schema.hasColumn(this.table, 'archive') in the previous query



via Mohamed Ben HENDA

No comments:

Post a Comment