SQLite CRUD

Node.js comes with SQLite built in. This example keeps a small movie list in an in-memory database, seeded on server start, and changes it with plain HTML forms.

Each form posts to this page, which runs a prepared statement and redirects back with 303 See Other, so reloading the page never sends a form twice. The database is shared by all visitors: reset brings back the seed data.

In-memory database, shared by all visitors.

Add a movie

Movies

15 / 50
TitleYearRating
Metropolis1927★★★★★
Edit
Modern Times1936★★★★★
Edit
Casablanca1942★★★★★
Edit
Rashomon1950★★★★★
Edit
Seven Samurai1954★★★★★
Edit
Vertigo1958★★★★★
Edit
2001: A Space Odyssey1968★★★★★
Edit
Cancel
Blade Runner1982★★★★★
Edit
Back to the Future1985★★★★★
Edit
Groundhog Day1993★★★★★
Edit
The Matrix1999★★★★★
Edit
Spirited Away2001★★★★★
Edit
Amélie2001★★★★★
Edit
Parasite2019★★★★★
Edit