Skip to content

Make DB the only server storage backend#42

Merged
pablonete merged 9 commits into
mainfrom
pablonete-db-only-storage
Jun 24, 2026
Merged

Make DB the only server storage backend#42
pablonete merged 9 commits into
mainfrom
pablonete-db-only-storage

Conversation

@pablonete

Copy link
Copy Markdown
Member

This finishes the storage migration aggressively now that existing data is non-production test data. Instead of preserving Blob/file/dual-write compatibility, the server is simplified to use Netlify DB as the only writable backend.

Summary

  • Removes Blob, file, and dual-write store implementations and the @netlify/blobs dependency.
  • Configures both Netlify Functions and the local Node server to use the DB store and DB magic-token store directly.
  • Simplifies the store contract by dropping legacy snapshot mutation compatibility methods.
  • Keeps a DB-only reset command, npm run data:reset-db, seeded from src/data.
  • Removes duplicate server/data seed files so src/data is the single seed source.
  • Updates README and storage docs for the DB-only model.
  • Cleans server builds before emitting to avoid stale compiled files from deleted modules.

Notes for review

  • This intentionally removes rollback compatibility with Blobs and local JSON storage.
  • NETLIFY_DATABASE_URL is now required for stateful Node/Netlify server paths.
  • No UI changes; screenshots are N/A.

Validation

  • npm run --silent lint
  • npm run --silent build
  • npm run --silent build:server
  • git --no-pager diff --check

Remove Blob, file, and dual-write storage paths now that the app can aggressively reset non-production data. Configure Netlify and Node runtimes to use the DB store directly, keep reset tooling DB-only, remove stale seed copies, and update docs for the DB-only storage model.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for kid-a ready!

Name Link
🔨 Latest commit 776170d
🔍 Latest deploy log https://app.netlify.com/projects/kid-a/deploys/6a3c58723707a50007fb3b82
😎 Deploy Preview https://deploy-preview-42--kid-a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

pablonete and others added 8 commits June 24, 2026 23:37
Temporarily run the DB reset script before the Netlify build so the next deploy initializes the schema and seed data for the DB-only storage rollout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply DB migrations and seed an empty database during server startup instead of running destructive reset commands during Netlify builds. Keep the manual reset command for explicit non-production resets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Switch DB connection setup from the legacy @netlify/neon wrapper to the current @netlify/database package while keeping Neon's query client for SQL execution. Update docs to use NETLIFY_DB_URL and ignore the local .netlify folder.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accept NETLIFY_DB_URL, NETLIFY_DATABASE_URL, or DATABASE_URL when they contain a Postgres URL, and fail clearly if Netlify Database has not provided a usable connection string.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the custom Node server path and rely on Netlify Dev for local function and database runtime parity. Switch DB access to the current Netlify Database package with a pool-backed SQL wrapper so local Postgres URLs and deployed database URLs both work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the custom Node server path and use Netlify Dev for local function/database parity. Configure the local Vite target to call Netlify Functions through the dev proxy and update docs/scripts accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the schema migration into netlify/database/migrations so Netlify Database detects and applies it automatically. Update runtime bootstrap, function bundling, and docs to use the native migration location.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Convert the API function from Lambda compatibility handler exports to the modern Request/Response function format with a direct /api/* config path, so Netlify Database can provide runtime connection context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pablonete pablonete merged commit 1b02346 into main Jun 24, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

1 participant