1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

Only cast money as numeric for Postgres

This commit is contained in:
Mel O'Hagan 2022-06-22 16:13:02 +01:00
parent 8154fe3445
commit 9603a92c2c

View file

@ -94,7 +94,7 @@ function generateSelectStatement(json: QueryJson, knex: Knex): any[] {
const schema = meta?.table?.schema
return resource.fields.map(field => {
const shortFieldName = field.match(/(?<=\.).*$/g)?.[0]
if (shortFieldName) {
if (shortFieldName && knex.client.config.client === "pg") {
const externalType = schema?.[shortFieldName].externalType
if (externalType?.includes("money")) {
const fieldName = field.split(/\./g)