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

Improve record implementation to allow record strings #41

Closed hammo92 closed 3 months ago

hammo92 commented 3 months ago

The Surreal SDK allows RecordId and StringRecordId in the create method; updated the zod custom validator to allow for both.

Added a transform in the ZOD validator for string values to allow the allow the passing of strings as a record value in an object.

hammo92 commented 3 months ago

Sorting some changes for fixing the issue with record arrays not generating types correctly, meant to merge this before pushing those changes though.