Closed bookshiyi closed 3 months ago
I'm not entirely clear on the concept. Is the idea to rewrite the generation to work locally without using the API, for offline use? The tool currently relies on ${supabaseUrl}/rest/v1/?apikey=${supabaseAnonKey}
to retrieve schema data, so internet access is required. Could you please provide more details on the goal?
According to my understanding,
The current code logic:
cli(.dart)
--config--> supadart-server(.ts)
--get--> supabase-server
disk
<--code-- cli(.dart)
<--json-- supadart-server(.ts)
<--swagger-- supabase-server
Is it possible to reconstruct it into this?
cli(.dart)
--get--> supabase-server
disk
<--code-- cli(.dart)
<--swagger-- supabase-server
This will facilitate custom generation rules and contribute(debug) code to generators.
I see, So this will probably remove the generate classes via website right? unless,, maintain dart generators and ts generators
Part of why i made it in nextjs first is:
I can see the clear benefits of what you are proposing, but i'd like to give it some thought
I see, So this will probably remove the generate classes via website right? unless,, maintain dart generators and ts generators
Part of why i made it in nextjs first is:
- Generate via web + can reuse it via serverless api
- Im more comfortable in ts
I can see the clear benefits of what you are proposing, but i'd like to give it some thought
btw, I also think that the web is very useful for many users, which is convenient for users to get started quickly, and simple tables can easily generate dart code without any installation.
There will indeed be a lot of workload to change to local mode. If you decide to do it, I will be happy to contribute to it.
And, this project is great enough currently, it helped me a lot. I'm glad I didn't meet you later.
It may be more difficult to do the type conversion part with pure dart than ts.
Is it possible that use dart to call the local ts code directly, so that the workload will be much less.
Is it possible that use dart to call the local ts code directly
done some research, there isn't a way afaik 😔
made a quick PR after reading this issue https://github.com/mmvergara/supadart/pull/41, hopefully i can play a bit with the generation the coming days, not sure if it fully works for me yet.
thanks for the effort btw :) i wish this kind of stuff was suppored directly in supabase ..
Now i see why is this necessary. the current implementation doesnt work with supabase instances running on local machine? @bookshiyi @nzlz
the server wont be able to fetch from private local-hosted supa instances the PR was the smallest change i could think of, but there might be better ways
If some one self hosted the supabase server on local network, the supadart vercle server can not reach it.
Switched to dart generators. now supports local generation
Thanks for your awesome idea, could we change the project to run on local only by pure dart without
.ts
?