Next.js Discord

Discord Forum

how would i connect my sqlite3 database?

Unanswered
Chilean Terrier posted this in #help-forum
Open in Discord
Chilean TerrierOP
I already have a database that is has data in there, but im not sure how to connect it.

21 Replies

European sprat
Other things that work with nodejs
@European sprat https://www.npmjs.com/package/sqlite3 Prisma ORM
Chilean TerrierOP
would i need to use prisima if i already have data inside the database?

nvm seems like i do
Chilean TerrierOP
I tried creating an api... but i keep getting a "page not found" error when i go localhost:3000/api/monsters
@Mozzy That's not how API routes work in /app https://nextjs.org/docs/app/building-your-application/routing/route-handlers
Chilean TerrierOP
can you help me?

i was able to see my monsters table through prisma studio
@Chilean Terrier can you help me? i was able to see my monsters table through prisma studio
I've never used an ORM, but I'm sure there's plenty of documentation
@Mozzy I've never used an ORM, but I'm sure there's plenty of documentation
Chilean TerrierOP
do u know how to make an api just by a database?
@Mozzy What do you mean?
Chilean TerrierOP
i have a database... and i want to use the data to show some info
for example i want to show these info without trying to make an api call
not sure show how i would do that
Chilean TerrierOP
im using prisma
You have to make an api fetch request of some sorts if you want to get that data...
Chilean TerrierOP
... not sure how to do that..
European sprat
use the prisma calls in the route handler for creating an API
@Chilean Terrier ... not sure how to do that..
European sprat
read the docs
The docs are really clear about all this
Chilean TerrierOP
i'll reread them again and will let u know if i get stuck