[GH-ISSUE #3971] Remove unused 'integer' import from drizzle schema (pg-core) #27102

Closed
opened 2026-04-17 17:55:07 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @Boby900 on GitHub (Aug 13, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3971

Is this suited for github?

  • Yes, this is suited for github

When generating the Drizzle schema for PostgreSQL (pgTable), the code currently imports 'integer' from "drizzle-orm/pg-core" even though it is not used in the resulting schema output. This creates unnecessary imports in generated files and may cause confusion for new users.

Describe the solution you'd like

Update the code generation logic so that 'integer' is only imported if it is actually needed for the table definition. For standard auth tables (user, session, account, verification), only 'text', 'timestamp', and 'boolean' should be imported unless integer columns exist in the schema.

Describe alternatives you've considered

Alternatively, always check the schema for any integer fields before determining the imports. Or allow customization to remove unused imports.

Additional context

This cleanup would improve clarity for code generated via 'npx @better-auth/cli generate' and prevent unnecessary imports for users who only use text/timestamp/boolean fields.

Originally created by @Boby900 on GitHub (Aug 13, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3971 ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. When generating the Drizzle schema for PostgreSQL (pgTable), the code currently imports 'integer' from "drizzle-orm/pg-core" even though it is not used in the resulting schema output. This creates unnecessary imports in generated files and may cause confusion for new users. ### Describe the solution you'd like Update the code generation logic so that 'integer' is only imported if it is actually needed for the table definition. For standard auth tables (user, session, account, verification), only 'text', 'timestamp', and 'boolean' should be imported unless integer columns exist in the schema. ### Describe alternatives you've considered Alternatively, always check the schema for any integer fields before determining the imports. Or allow customization to remove unused imports. ### Additional context This cleanup would improve clarity for code generated via 'npx @better-auth/cli generate' and prevent unnecessary imports for users who only use text/timestamp/boolean fields.
GiteaMirror added the lockedenhancement labels 2026-04-17 17:55:07 -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#27102