Skip to content

v2.1.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 29 Apr 16:31
bf985ea

New features

PreferRepeatableRead

The main headline feature here is our new PreferRepeatableRead transaction option which will downgrade the transaction isolation from Serializable to RepeatableRead iff the server thinks the query is safe to downgrade. You can opt into this behavior by using withTransactionOptions:

export const client = createClient()
  .withTransactionOptions({
    isolation: IsolationLevel.PreferRepeatableRead,
  });

withTransactionOptions applies to implicit transactions as well

  • Both isolation and readonly will now affect the implicit transaction that every query run with this client uses. You can use this to set a read-only client with RepeatableRead isolation like:
export readonlyClient = createClient()
  .withTransactionOptions({
    isolation: IsolationLevel.RepeatableRead,
    readonly: true,
  });

What's Changed