---
title: "Discussion on \"One trial per inbox in Supabase, enforced by Postgres\" | Hashnode"
description: "Discussion on \"One trial per inbox in Supabase, enforced by Postgres\". A claim key built from the email, a unique index on trial_claims, and a trigger that grants credits only the first time. Plus a small hook that turns away throwaway domains."
url: "https://hashnode.com/posts/one-trial-per-inbox-supabase-postgres/6acf3c2cc839f4e982f9e3d5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [One trial per inbox in Supabase, enforced by Postgres](https://elijahbrown.hashnode.dev/one-trial-per-inbox-supabase-postgres?utm_source=hashnode&utm_medium=feed)

A claim key built from the email, a unique index on trial\_claims, and a trigger that grants credits only the first time. Plus a small hook that turns away throwaway domains.

Oct 14 · 9 min read · elijahbrown.hashnode.dev  
Read the article

-   [#supabase](https://hashnode.com/tag/supabase)
-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#saas](https://hashnode.com/tag/saas)

## Written by

[Elijah Brown](https://hashnode.com/@elijahbrown)

@elijahbrown · Dubai, UAE

  
[View profile](https://hashnode.com/@elijahbrown)

Building Orisift. Writing about DNS, phones and forms.

I'm building Orisift, a developer API that checks phone numbers, email domains and IP addresses against reference data, and says what it couldn't find out. I write about the small standards details that decide how forms behave.

## Responses 1

Markdown supported · ⌘↵ to post

[Kamran Khan](https://hashnode.com/@kamrankhandev)

[Oct 14](https://hashnode.com/posts/one-trial-per-inbox-supabase-postgres/6acf3c2cc839f4e982f9e3d5/comment/6acf99c7b666d649a059b398)

Solid write-up — the on delete set null detail is the one most implementations miss, and the two-session race test on the unique index is the right way to prove the design.

One hard-won edge worth calling out: the claim key is permanent, and dot-collapsing makes a typo burn the real mailbox. If I fat-finger my own signup as [jan.edoe@gmail.com](mailto:jan.edoe@gmail.com), [janedoe@gmail.com](mailto:janedoe@gmail.com) is taken forever — and when the actual owner of [janedoe@gmail.com](mailto:janedoe@gmail.com) signs up, they land at zero with no trial and no self-serve path back. The cost of a false match here isn't just "one account without credits," it can silently deny the mailbox's real owner. Worth surfacing which key blocked the grant, or adding a support-side action to release a claim row, because this becomes a support ticket in the first week.

Sharp question: the key only collapses dots for gmail.com, but Google Workspace domains ignore dots too — and you can't enumerate Workspace domains statically. [jane.doe@company.com](mailto:jane.doe@company.com) and [janedoe@company.com](mailto:janedoe@company.com) are different keys in this design while Google delivers both to the same inbox. Did you consider that hole, or is MX-checking at insert time too much dependency on the hot path?
