[PR #7323] feat(adapters): add advanced.database.usePlural as fallback for adapter-specific option #7228

Open
opened 2026-03-13 13:29:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7323
Author: @Bekacru
Created: 1/13/2026
Status: 🔄 Open

Base: canaryHead: claude/slack-add-advanced-useplural-WHKYL


📝 Commits (1)

  • 0e80707 feat(adapters): add advanced.database.usePlural as fallback for adapter-specific option

📊 Changes

5 files changed (+39 additions, -13 deletions)

View changed files

📝 packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts (+10 -5)
📝 packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts (+3 -0)
📝 packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts (+8 -2)
📝 packages/core/src/db/adapter/factory.ts (+8 -6)
📝 packages/core/src/types/init-options.ts (+10 -0)

📄 Description

  • Add usePlural to advanced.database config in init-options.ts
  • Update adapter factory to use config.usePlural ?? options.advanced?.database?.usePlural
  • Update Drizzle adapter to use the fallback for internal usePlural usages
  • Update Prisma adapter to use the fallback for internal usePlural usages
  • Mark adapter-specific usePlural options as deprecated with guidance to use advanced.database.usePlural instead

This allows users to set usePlural once in advanced.database and have it apply to all adapters, while still allowing adapter-specific overrides if needed


Summary by cubic

Add a global advanced.database.usePlural option that acts as a fallback for adapter-specific usePlural. This unifies plural table handling across adapters while still allowing per-adapter overrides.

  • New Features

    • Introduced advanced.database.usePlural (default false) to control plural table names across all adapters.
    • Adapter factory, Drizzle, and Prisma now resolve usePlural via adapterConfig.usePlural ?? advanced.database.usePlural.
    • Marked usePlural in Drizzle/Prisma/Kysely adapter configs as deprecated.
  • Migration

    • Set advanced.database.usePlural in your main config.
    • Keep adapter-specific usePlural only if you need an override.
    • Plan to remove adapter-level usePlural in a future release.

Written for commit 0e80707ad8. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7323 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 1/13/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `claude/slack-add-advanced-useplural-WHKYL` --- ### 📝 Commits (1) - [`0e80707`](https://github.com/better-auth/better-auth/commit/0e80707ad855ac5435075824a093cd955977a3cd) feat(adapters): add advanced.database.usePlural as fallback for adapter-specific option ### 📊 Changes **5 files changed** (+39 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts` (+10 -5) 📝 `packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts` (+3 -0) 📝 `packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts` (+8 -2) 📝 `packages/core/src/db/adapter/factory.ts` (+8 -6) 📝 `packages/core/src/types/init-options.ts` (+10 -0) </details> ### 📄 Description - Add usePlural to advanced.database config in init-options.ts - Update adapter factory to use config.usePlural ?? options.advanced?.database?.usePlural - Update Drizzle adapter to use the fallback for internal usePlural usages - Update Prisma adapter to use the fallback for internal usePlural usages - Mark adapter-specific usePlural options as deprecated with guidance to use advanced.database.usePlural instead This allows users to set usePlural once in advanced.database and have it apply to all adapters, while still allowing adapter-specific overrides if needed <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add a global advanced.database.usePlural option that acts as a fallback for adapter-specific usePlural. This unifies plural table handling across adapters while still allowing per-adapter overrides. - **New Features** - Introduced advanced.database.usePlural (default false) to control plural table names across all adapters. - Adapter factory, Drizzle, and Prisma now resolve usePlural via adapterConfig.usePlural ?? advanced.database.usePlural. - Marked usePlural in Drizzle/Prisma/Kysely adapter configs as deprecated. - **Migration** - Set advanced.database.usePlural in your main config. - Keep adapter-specific usePlural only if you need an override. - Plan to remove adapter-level usePlural in a future release. <sup>Written for commit 0e80707ad855ac5435075824a093cd955977a3cd. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:29:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7228