Wrangler Superflare ORM for HONO Workaround #61
fre2mansur
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, Superflare only supports remix new projects, but I have an existing new Cloudflare wrangler project. I am using the HONO for routers.
Trying to integrate Superflare into my project and it works as expected.
Install
npx superflare@latest
Generate the model
npx superflare generate model Cats --migration
its sending some error as
TypeError: Cannot open database because the directory does not exist
It does not recognize the Database
This config is not working
But it will generate the sql file in your
root/migrations/0000_create_cats.sql
Migrate using wrangler
now use the wrangler command to migrate
wrangler d1 migrations apply <DATABASE_NAME> [OPTIONS]
D1 Connection to access the Model Query
Since it does not recognize the DB config, I have to create the Middleware to set the config as below
Thats it.
I'm still figuring out how to make the Superflare recognize the wrangler.toml. This would help to get full integration of superflare.
Please share your Thoughts.
Beta Was this translation helpful? Give feedback.
All reactions