twikoojs / twikoo-cloudflare

9 stars 11 forks source link

Documentation Enhancement: Insert Necessary Step in Cloudflare D1 Database Setup Instructions #3

Closed JosieWei2023 closed 3 months ago

JosieWei2023 commented 3 months ago

While following the setup instructions for the Cloudflare D1 database, I noticed that an important configuration step might be beneficial between the creation of the database and the execution of the schema.

The current setup process generates important details like database_name and database_id, which are crucial for the wrangler.toml configuration. However, there is currently no explicit instruction to update these values immediately after database creation, which could potentially lead to configuration errors for new users.

I recommend restructuring the setup steps to include a specific instruction to update the wrangler.toml file right after the database is created and before the schema is executed. The revised instructions would be more explicit and user-friendly:

4. Create the Cloudflare D1 database:
   npx wrangler d1 create twikoo

5. Copy the 'database_name' and 'database_id' from the output of the previous command and paste them into the 'wrangler.toml' file, replacing the original values.

6. Set up the schema:
   npx wrangler d1 execute twikoo --remote --file=./schema.sql
Tao-VanJS commented 3 months ago

Thanks @JosieWei2023!

I updated the setup instructions based on your feedback.

Tao-VanJS commented 3 months ago

Created https://github.com/twikoojs/twikoo-cloudflare/pull/1.