Tool which generates a typescript client for SurrealDB and zod schema of a given database
SurrealDB 2 has new functions that did not exist before. When running surrealdb-client-generator in a code with such functions, it fails. As an example, `record::id` causes an error to be thrown. > Record functions before SurrealDB 2.0 were located inside the module [meta](https://surrealdb.com/docs/surrealql/functions/database/meta). As of version 2.0, these functions are now part of SurrealDB's [record](https://surrealdb.com/docs/surrealql/functions/database/record) functions. ```haskell ./node_modules/.bin/surql-gen --no-generateClient No config file found. Starting temporary SurrealDB instance Temporary SurrealDB instance started at http://localhost:33789 Connecting to database Connected to database successfully 🔴 This did not work as expected 🥺 🔴 I am sorry that this happened, and I kindly ask for your help to fix this. 🔴 🔴 Please open an issue here: 🔴 👉 https://github.com/sebastianwessel/surrealdb-client-generator/issues 🔴 🔴 Please copy & paste the following code into the ticket: ===== ResponseError: There was a problem with the database: Parse error: Failed to parse query at line 109 column 61 expected function arguments | 109 | ...ice(record::id($value.id), 0, 4); | ^ at Surreal.query_raw (/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/surrealdb/dist/index.cjs:1:45589) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Surreal.query (/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/surrealdb/dist/index.cjs:1:45244) at async insertDefinitions (/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@sebastianwessel/surql-gen/dist/index.js:92:3) at async main (/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@sebastianwessel/surql-gen/dist/index.js:1006:9) ```
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by zvictor and has received 5 comments.