Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

knex like query

const getResults = (options) => {
    let query = knex('table');
    if (options.where) {
        query = query.where('franchisee_name', 'like', '%jackmarker%');
    }

    if (options.other) {
        query = query.where('company', 'like', '%marker%');
    }

    return query.select();
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #knex #query
ADD COMMENT
Topic
Name
4+3 =