sebastianwessel / surrealdb-client-generator

Tool which generates a typescript client for SurrealDB and zod schema of a given database
MIT License
76 stars 12 forks source link

Record array returned as single record #47

Closed hammo92 closed 3 months ago

hammo92 commented 3 months ago

The tests are passing but in a live environment there is still an issue with record arrays. When getting the table info Surreal returns the array field definition, and a nested definition;:

roles: 'DEFINE FIELD roles ON organisation TYPE array<record<role>> DEFAULT [] PERMISSIONS FULL',
'roles[*]': 'DEFINE FIELD roles[*] ON organisation TYPE record<role> PERMISSIONS FULL'

but our tests check only for the first definition

roles: 'DEFINE FIELD roles ON organisation TYPE array<record<role>> DEFAULT [] PERMISSIONS FULL

As our test for nested arrays is incorrect as #46 these two issues are likely related.