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

No codes was generated except the client_generated/PropType.ts #2

Closed limcheekin closed 1 year ago

limcheekin commented 1 year ago

Hi there,

I run the npx surql-gen and see the following prompts display in my console:

No config file provided - looking for surql-gen.json in current folder
No config file found.
connect to database
Generating schema in /home/limcheekin/ws/rag/client_generated/_generated
database closed

Thanks for using my tool

Please 🙏 give a star ⭐️ on github: 👉 https://github.com/sebastianwessel/surrealdb-client-generator

If you run into an issue, please let me know so it can get fixed.
👉 https://github.com/sebastianwessel/surrealdb-client-generator/issues

Good luck with your project. 👋 Cheers, and happy coding!

However, when I look into the client_generated directory, I only see PropType.ts file.

I started the surrealdb using docker with the following command:

docker run --rm --pull always -p 8000:8000 surrealdb/surrealdb:latest start --log trace --user root --pass root

Attached here is myschema.surql (Please change the file extension of the attached file as GitHub issues doesn't support surql file).

Kindly let's me know if you need more information.

Thanks in advance. Appreciate your support.

sebastianwessel commented 1 year ago

There was an issue with handling table names starting with an uppercase character. This issue should be resolved in recent version 1.1.0.

Hope, it will work now @limcheekin 🙏

limcheekin commented 1 year ago

Thanks for quick turnaround!

It works now. :)

By the way, what is the standard naming convention for table name in SurrealDB? I'm using ClassName for table name and propertyName for field name at the moment.

sebastianwessel commented 1 year ago

I don't know if there is a strict naming convention. But from what I see in the documentation, it is mostly lowercased/camelCased. Might be a question for the surreal discord channel 🤷‍♂️