rate limit modelName can't have schema name #899

Closed
opened 2026-03-13 08:09:09 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @ShahriarKh on GitHub (Mar 23, 2025).

rateLimit can only use tables created in public schema:

export const auth = betterAuth({
    rateLimit: {
        // ...other options
        storage: "database",
        modelName: "rateLimit",             // works
        modelName: "someSchema.rateLimit",  // doesn't work
    },
})

Using a custom schema shows this in response:

undefined is not an object (evaluating 'schema[model].fields')

I think this issue is similar: #1884

Database: Postgres 16
better-auth: 1.2.4

Originally created by @ShahriarKh on GitHub (Mar 23, 2025). rateLimit can only use tables created in `public` schema: ```tsx export const auth = betterAuth({ rateLimit: { // ...other options storage: "database", modelName: "rateLimit", // works modelName: "someSchema.rateLimit", // doesn't work }, }) ``` Using a custom schema shows this in response: ``` undefined is not an object (evaluating 'schema[model].fields') ``` I think this issue is similar: #1884 Database: Postgres 16 better-auth: 1.2.4
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#899