Skip to content

Commit

Permalink
fest: improve error format when column data_type not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Jul 21, 2024
1 parent f177e2f commit ad3eb8d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/buildQueryCriteria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,20 @@ function buildSQL(criterium: QueryCriterium, schema: Schema, values: Values) {
sql.push(processText(field, criterium, values));
break;
case 'REAL':
case 'INT':
case 'INTEGER':
sql.push(processNumber(field, criterium, values));
break;
case 'BOOLEAN':
sql.push(processBoolean(field, criterium, values));
break;
case 'BLOB':
case 'NULL':
break;
default:
throw new Error(`Type ${column.type} is not supported`);
throw new Error(
`Type ${column.type} is not supported. Consider using STRICT mode to avoid issues. The following types are supported: TEXT, REAL, INTEGER, BOOLEAN`,
);
}
}
return `(${sql.join(' OR ')})`;
Expand Down

0 comments on commit ad3eb8d

Please sign in to comment.