mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-01-08 12:28:05 +00:00
Fix query when filtering by bigint type field (#268)
This commit is contained in:
parent
e0933f10b2
commit
3b27177389
@ -382,7 +382,7 @@ export class Database {
|
||||
Object.entries(where).forEach(([field, filters]) => {
|
||||
filters.forEach((filter, index) => {
|
||||
// Form the where clause.
|
||||
const { not, operator, value } = filter;
|
||||
let { not, operator, value } = filter;
|
||||
const columnMetadata = repo.metadata.findColumnWithPropertyName(field);
|
||||
assert(columnMetadata);
|
||||
let whereClause = `${tableName}.${columnMetadata.propertyAliasName} `;
|
||||
@ -402,6 +402,9 @@ export class Database {
|
||||
} else if (operator === 'in') {
|
||||
whereClause += '(:...';
|
||||
} else {
|
||||
// Convert to string type value as bigint type throws error in query.
|
||||
value = value.toString();
|
||||
|
||||
whereClause += ':';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user