Skip to content

A minimal pastebin-like SvelteKit example app that uses a local SQLite database via the Prisma ORM through a SvelteKit endpoint.

Notifications You must be signed in to change notification settings

malted/sveltekit-sqlite

Repository files navigation

sveltekit-sqlite

A minimal pastebin-like SvelteKit example app that uses a local SQLite database via the Prisma ORM through a SvelteKit endpoint.

Deploying this project to Vercel or similar will not work due to the fact that the instances serving the project are ephemeral. When more instances are spun up to accommodate for increased load, they will not share the same filesystem, and hence will not share the same database.

The database and its required files are included in this repository for demonstration purposes, though it is empty.

To generate it from scratch;

  • Make sure you have everything installed; run pnpm install
  • Delete everything inside /prisma except for /prisma/schema.prisma.
  • Run pnpx prisma migrate dev --name init.
  • Run pnpx prisma generate.

I'm using pnpx here, which is pnpm's equivalent to npm's npx.

Index page

image

Inputting text into the fields

image

The generated post, located at /:title (this page would be at /Doggo ipsum)

image

About

A minimal pastebin-like SvelteKit example app that uses a local SQLite database via the Prisma ORM through a SvelteKit endpoint.

Resources

Stars

Watchers

Forks