Skip to main content

[Plugin] - Add @db/driver options (1/4)

  • Generic database driver

  • Starts with mock / memory implementation (will warn you)

    • Can also be hooked up to a custom implementation (e.g. → REST API)

  • Merge a specific DB plugin to hook it up to an actual Database Solution, e.g.

    • with/db-mongoose → ‘@db/mongoose‘ → (✅ done, but to be published)

    • with/db-supabase → ‘@db/supabase‘ → (📆 planned)

    • with/db-drizzle → ‘@db/drizzle‘ → (📆 planned)

    • with/db-convex → ‘@db/convex‘ → (📆 planned)

    • …

  • Follows the “workspace driver“ pattern:

    • Import DB essentials from @auth/driver (workspace)

      • Create / Import DB models with common interfaces from Zod schemas

        • insert(), insertOne(), insertMany(), …

        • find(), findOne(), findMany(), …

        • update(), updateOne(), updateMany(), …

        • delete(), deleteOne(), deleteMany(), …

        • findOrCreate(), upsertOne(), …

        • …

    • Can config / add / swap actual implementations without changing app code

Status: Planned

Log in to comment and vote

No comments yet

Be the first to share your thoughts.