Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Fix #358 case-insensitive filter #360

Merged
merged 3 commits into from
Nov 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix #358 case-insensitive filter
  • Loading branch information
ajewelbd committed Nov 9, 2022
commit 3a236442065ac33d0179a2ae9ba798aa7b910acd
11 changes: 11 additions & 0 deletions lib/pg/sql-builder/FunctionBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ class PGFunctionBuilder extends FunctionBuilder {
this._outputObj.sql.push(')')
}
}

_createLikeComparisonForColumn(not, left, right) {
if (not) {
this._outputObj.sql.push('(', left, 'IS NULL', 'OR')
}

this._outputObj.sql.push(left, `${not}ILIKE`) // This 'ILIKE' change case-sensitive issue #358.
this._addFunctionArgs(right, true, ' || ')
this._outputObj.sql.push('ESCAPE', "'^'")
if (not) this._outputObj.sql.push(')')
}
}

module.exports = PGFunctionBuilder