sebastianwessel / surrealdb-client-generator

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

Fix nested arrays #48

Closed hammo92 closed 4 months ago

hammo92 commented 4 months ago

There were issues with array definitions caused by the duplicate field definitions in the schema returned from SurrealDB

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

The new implementation should fix the issue. Have added some more comprehensive tests for the schema generation.

Should fix #46 and #47

sebastianwessel commented 4 months ago

lgtm. Will merge tonight and publish new release