mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 21:56:00 +00:00
using ilike instead of like for postgres
This commit is contained in:
@@ -39,7 +39,7 @@ export function dumpSqlCondition(dmp: SqlDumper, condition: Condition) {
|
|||||||
break;
|
break;
|
||||||
case 'like':
|
case 'like':
|
||||||
dumpSqlExpression(dmp, condition.left);
|
dumpSqlExpression(dmp, condition.left);
|
||||||
dmp.put(' ^like ');
|
dmp.put(dmp.dialect.ilike ? ' ^ilike ' : ' ^like ');
|
||||||
dumpSqlExpression(dmp, condition.right);
|
dumpSqlExpression(dmp, condition.right);
|
||||||
break;
|
break;
|
||||||
case 'notLike':
|
case 'notLike':
|
||||||
|
|||||||
1
packages/types/dialect.d.ts
vendored
1
packages/types/dialect.d.ts
vendored
@@ -1,6 +1,7 @@
|
|||||||
export interface SqlDialect {
|
export interface SqlDialect {
|
||||||
rangeSelect?: boolean;
|
rangeSelect?: boolean;
|
||||||
limitSelect?: boolean;
|
limitSelect?: boolean;
|
||||||
|
ilike?: boolean;
|
||||||
rowNumberOverPaging?: boolean;
|
rowNumberOverPaging?: boolean;
|
||||||
stringEscapeChar: string;
|
stringEscapeChar: string;
|
||||||
offsetFetchRangeSyntax?: boolean;
|
offsetFetchRangeSyntax?: boolean;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const { postgreSplitterOptions } = require('dbgate-query-splitter/lib/options');
|
|||||||
/** @type {import('dbgate-types').SqlDialect} */
|
/** @type {import('dbgate-types').SqlDialect} */
|
||||||
const dialect = {
|
const dialect = {
|
||||||
rangeSelect: true,
|
rangeSelect: true,
|
||||||
|
ilike: true,
|
||||||
// stringEscapeChar: '\\',
|
// stringEscapeChar: '\\',
|
||||||
stringEscapeChar: "'",
|
stringEscapeChar: "'",
|
||||||
fallbackDataType: 'varchar',
|
fallbackDataType: 'varchar',
|
||||||
|
|||||||
Reference in New Issue
Block a user