Hello!
I am facing an issue when loading some table (collection) from one of our MariaDB database. The targeted table has custom relation (check screenshot bellow) that seem to prevent the agent to do the proper projection.
Once the foreign key constraints are removed, the collection can load properly.
Thanks!
Feature(s) impacted
Loading collection
Observed behavior
Loading collection related to a MariaDB table fails due to custom relation (cf image below).
Expected behavior
The collection loads successfully.
Failure Logs
===== An exception was raised =====
GET /patient?{
timezone: Europe/Paris,
fields[health_insurance_fund]: name,
fields[identity]: id,
fields[patient]: address,address_2,application_id,birthdate,birthname,city,civility,country,created_date,created_from,deactivated_dtm,email,firstname,gender,health_insurance_fund,icd_codes,identity,inactive,inactive_dtm,inclusion_dtm,ipp,lastname,long_term_condition,middle_name,nir,person_to_notify,phone_numbers,referring_cardiologist_id,referring_physician_id,research_consent,rhythmologist,routine_care_consent,source,state,updated_date,vendor_id,zip_code,
fields[rhythmologist]: identity,
page[number]: 1,
page[size]: 15
}
Invalid projection
Error: Invalid projection
at Function.parseProjection (/Users/juliensarazin/workspace/implicity-healthcare/shared/nest-admin/node_modules/@forestadmin/agent/src/agent/utils/query-string.ts:62:13)
at Function.parseProjectionWithPks (/Users/juliensarazin/workspace/implicity-healthcare/shared/nest-admin/node_modules/@forestadmin/agent/src/agent/utils/query-string.ts:67:42)
at ListRoute.handleList (/Users/juliensarazin/workspace/implicity-healthcare/shared/nest-admin/node_modules/@forestadmin/agent/src/agent/routes/access/list.ts:22:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at ErrorHandling.errorHandler (/Users/juliensarazin/workspace/implicity-healthcare/shared/nest-admin/node_modules/@forestadmin/agent/src/agent/routes/system/error-handling.ts:21:7)
at Logger.logger (/Users/juliensarazin/workspace/implicity-healthcare/shared/nest-admin/node_modules/@forestadmin/agent/src/agent/routes/system/logger.ts:20:7)
at bodyParser (/Users/juliensarazin/workspace/implicity-healthcare/shared/nest-admin/node_modules/koa-bodyparser/index.js:95:5)
at cors (/Users/juliensarazin/workspace/implicity-healthcare/shared/nest-admin/node_modules/@koa/cors/index.js:110:16)
===================================
info: [200] GET /patient/count - 23ms
Context
- Project name: mpcty-admin
- Team name: operator
- Environment name: Development
- Agent type & version:
@forestadmin/agent": "^1.0.0-beta.60"
, - Recent changes made on your end if any: None