Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blog example lack of detailed documentation #2

Closed
ifyour opened this issue Mar 7, 2024 · 4 comments
Closed

blog example lack of detailed documentation #2

ifyour opened this issue Mar 7, 2024 · 4 comments

Comments

@ifyour
Copy link

ifyour commented Mar 7, 2024

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
Copy link
Author

ifyour commented Mar 7, 2024

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? 🤣

@ifyour ifyour closed this as completed Mar 10, 2024
@ongnxco
Copy link

ongnxco commented Mar 16, 2024

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
Copy link
Author

ifyour commented Mar 17, 2024

@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
Copy link

ongnxco commented Mar 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants