[PR #7332] fix(postgres): allow updating string[] (text[]) fields without errors #7236

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

📋 Pull Request Information

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

Base: canaryHead: fix/postgres-string-array


📝 Commits (4)

  • 7c3587a fix: postgres string[] (text[]) update regression
  • 3f4a9dc fix(kysely): handle postgres string[] fields on create and update
  • 161e917 fix: handle postgres string[] correctly in kysely adapter
  • 42bee1d fix(postgres): correctly handle string[] (text[]) updates in kysely adapter

📊 Changes

2 files changed (+59 additions, -6 deletions)

View changed files

📝 packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts (+25 -5)
📝 packages/better-auth/src/adapters/kysely-adapter/test/adapter.kysely.pg.test.ts (+34 -1)

📄 Description

Summary

Fixes an issue where updating Postgres string[] / text[] fields would fail.

Changes

  • Corrected update handling for Postgres array fields
  • Added a regression test to ensure updates work as expected

Tests

  • Added should update postgres string[] (text[]) fields without error

fixes #7155


Summary by cubic

Fix Postgres string[] (text[]) handling in the Kysely adapter for create and update, so writing array fields no longer throws errors.

  • Bug Fixes
    • Convert string[] values to Postgres array literals during create/update.
    • Added a regression test to verify updating user.organizationType (string[]) succeeds.

Written for commit 42bee1d1d2. 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/7332 **Author:** [@MuzzaiyyanHussain](https://github.com/MuzzaiyyanHussain) **Created:** 1/13/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `fix/postgres-string-array` --- ### 📝 Commits (4) - [`7c3587a`](https://github.com/better-auth/better-auth/commit/7c3587a4936301fb1fc7eabd68cba055a5de1dbb) fix: postgres string[] (text[]) update regression - [`3f4a9dc`](https://github.com/better-auth/better-auth/commit/3f4a9dc85bfef34b57eb9997c4de7347882839a3) fix(kysely): handle postgres string[] fields on create and update - [`161e917`](https://github.com/better-auth/better-auth/commit/161e917018e2f7ccd004d98c93e791a3eb21f570) fix: handle postgres string[] correctly in kysely adapter - [`42bee1d`](https://github.com/better-auth/better-auth/commit/42bee1d1d22d3ce21baa3bdba13736db6dc9c98b) fix(postgres): correctly handle string[] (text[]) updates in kysely adapter ### 📊 Changes **2 files changed** (+59 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts` (+25 -5) 📝 `packages/better-auth/src/adapters/kysely-adapter/test/adapter.kysely.pg.test.ts` (+34 -1) </details> ### 📄 Description ### Summary Fixes an issue where updating Postgres `string[]` / `text[]` fields would fail. ### Changes - Corrected update handling for Postgres array fields - Added a regression test to ensure updates work as expected ### Tests - Added `should update postgres string[] (text[]) fields without error` fixes #7155 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fix Postgres string[] (text[]) handling in the Kysely adapter for create and update, so writing array fields no longer throws errors. - **Bug Fixes** - Convert string[] values to Postgres array literals during create/update. - Added a regression test to verify updating user.organizationType (string[]) succeeds. <sup>Written for commit 42bee1d1d22d3ce21baa3bdba13736db6dc9c98b. 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:15 -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#7236