yusukebe / honox-examples

HonoX examples
48 stars 3 forks source link

blog example lack of detailed documentation #2

Closed ifyour closed 7 months ago

ifyour commented 7 months ago

In the blog example, when I run npm run dev, I get the following error on the console:

D1_ERROR: no such table: articles

May I ask if there are any steps that I have erred in this example? It looks like I'm not synchronizing the table structure to local SQLite.

ifyour commented 7 months ago

Based on the feedback from this issue, it's working fine for me, but I'm a little confused as to whether this is unintended behavior of the plugin. Note here that a global installation of sqlite3 may be required.

cd projects/blog
mkdir -p .mf/d1/DB
sqlite3 .mf/d1/DB/db.sqlite < blog.sql

Then run npm run dev and it works fine. Or is there a better way to initialize the table structure to local SQLite? 🤣

ongnxco commented 7 months ago

Based on the feedback from this issue, it's working fine for me, but I'm a little confused as to whether this is unintended behavior of the plugin.

mkdir -p .mf/d1/DB
sqlite3 .mf/d1/DB/db.sqlite < blog.sql

Then run npm run dev and it works fine. Or is there a better way to initialize the table structure to local SQLite? 🤣

Its still not working

POST  /articles/create
GET   /articles/create
POST  /articles/preview
GET   /articles/:id
GET   /
GET   /*
D1_ERROR: no such table: articles
ifyour commented 7 months ago

@ongnxco Are you executing the path correctly? I tested that it is working.

npm i sqlite3 -g
cd projects/blog
mkdir -p .mf/d1/DB
sqlite3 .mf/d1/DB/db.sqlite < blog.sql
ongnxco commented 7 months ago

It would be nice if it was automatic like this https://hub.nuxt.com/docs/recipes/drizzle#migrations