Closed
Description
It would be useful if you could register your own query operator.
var adapter = new DSSqlAdapter({
client: 'mysql',
connection: {
user: 'root'
},
queryOperators: {
'search': (query, field, value) => {
return query.whereRaw(`MATCH(${query.raw(field)}) AGAINST(? IN BOOLEAN MODE)`, value)
},
'|search': (query, field, value) => {
return query.orWhereRaw(`MATCH(${query.raw(field)}) AGAINST(? IN BOOLEAN MODE)`, value)
}
}
}
They should maybe be executed before the built in operators to allow overriding.
https://github.com/js-data/js-data-sql/blob/0.11.9/src/index.js#L350
Metadata
Metadata
Assignees
Labels
No labels