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

Fix nested arrays #48

Closed hammo92 closed 3 months ago

hammo92 commented 3 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 3 months ago

lgtm. Will merge tonight and publish new release