Browse Source

fix: if it is bigint type, then go for eq instead of like

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
pull/1156/head
Wing-Kam Wong 3 years ago
parent
commit
0efe569e70
  1. 5
      packages/nc-gui/components/project/spreadsheet/mixins/spreadsheet.js

5
packages/nc-gui/components/project/spreadsheet/mixins/spreadsheet.js

@ -163,7 +163,10 @@ export default {
concatenatedXWhere() {
let where = ''
if (this.searchField && this.searchQuery.trim()) {
if (['text', 'string'].includes(this.sqlUi.getAbstractType(this.availableColumns.find(({ _cn }) => _cn === this.searchField) || this.availableColumns[0]))) {
const col = this.availableColumns.find(({ _cn }) => _cn === this.searchField) || this.availableColumns[0]
// bigint values are displayed in string format in UI
// when searching bigint values, the operator should be 'eq' instead of 'like'
if (['text', 'string'].includes(this.sqlUi.getAbstractType(col)) && col.dt !== 'bigint') {
where = `(${this.searchField},like,%${this.searchQuery.trim()}%)`
} else {
where = `(${this.searchField},eq,${this.searchQuery.trim()})`

Loading…
Cancel
Save