---
title: "Supabase RLS patterns I keep copy-pasting"
url: https://memory.wiki/8512f1485e0c
updated: 2026-03-28T07:32:00.000Z
hub: https://memory.wiki/hub/memorywiki-demo
concept_count: 10
source: "Memory.Wiki"
---
# Supabase RLS patterns I keep copy-pasting

Cross-AI portability is the structural moat OpenAI and Anthropic can't build for themselves. The user's context, exported as a public URL, becomes infrastructure that survives any single vendor's pivot. That's why the right primitive isn't an API key — it's a permalink.

Most personal-knowledge tools optimise for input. The friction is on the way in: capture this thought, file it, tag it, link it. But the value lives on the way OUT — when the system surfaces the right note at the right moment without you asking. Capture-heavy products are easier to build; output-heavy ones are what people actually pay for.

The interesting thing about long-context models isn't that they can read more — it's that they finally make the *retrieval* problem optional. When a model can hold the whole repo in context, the question shifts from "what should I fetch?" to "what should I show?". That's a UX question, not an infrastructure one.

### Three rules I keep returning to

- Ship one feature, deeply, before two features shallowly.
- The interface IS the product. The engine just has to keep up.
- Anything important should fit on one screen.

```swift
// SwiftUI: keep all five tab views mounted across tab switches so
// each view's @StateObject model persists.
ZStack {
    ForEach(AppTab.allCases, id: \.self) { tab in
        view(for: tab)
            .opacity(router.selectedTab == tab ? 1 : 0)
            .allowsHitTesting(router.selectedTab == tab)
    }
}
```

| Provider | Strength | Weakness |
|---|---|---|
| Claude | Long context, instruction following | Slow for tiny prompts |
| GPT-4o | Multimodal, fast | Drifts on long sessions |
| Cursor | Code-aware ranking | Locked to editor |

## Open questions

Reading other people's code is a higher-leverage activity than writing your own. You learn three things at once: what works, what doesn't, and why someone smart picked the trade-off you'd never have considered. The ratio of read-to-write hours quietly separates the engineers who plateau from the ones who keep compounding.

---

## Concepts in this document
- **Long-context models** _(concept)_
  Enable large context retention, shifting the problem from retrieval to what to show.
- **GPT-4o** _(entity)_
  Multimodal AI provider referenced in comparisons.
- **Claude** _(entity)_
  AI provider cited for long-context capabilities.
- **Output-heavy design** _(concept)_
  The document's central thesis that knowledge systems create value through retrieval and surfacing, not just capture.
- **Code reading** _(concept)_
  A high-leverage engineering activity that accelerates professional growth through trade-off analysis.
- **SwiftUI state management** _(concept)_
  Technical implementation detail showing how to persist view state across tab switches using ZStack and @StateObject.
- **Row-Level Security patterns** _(concept)_
  The document title and core focus, collecting reusable RLS implementations the author repeatedly references.
- **Cross-vendor portability** _(concept)_
  Central argument that user-exported context as URLs creates independence from any single AI vendor's decisions.
- **Supabase** _(entity)_
  Backend-as-a-service platform where RLS patterns are implemented and documented.
- **Interface-first development** _(concept)_
  Core design principle stated that the interface IS the product and engine merely supports it.

## Concept relations (within this doc's concepts)
- **GPT-4o** trades off in **Long-context models**
- **Interface-first development** reinforces ux priority in **Output-heavy design**
- **Supabase** platform for implementing **Row-Level Security patterns**
- **Claude** exemplifies strength in **Long-context models**
- **Cross-vendor portability** enables independence via **Row-Level Security patterns**
- **GPT-4o** compared against **Claude**
- **Claude** compared with **GPT-4o**
- **Long-context models** transforms retrieval to **Output-heavy design**
- **GPT-4o** alternative for multimodal **Long-context models**
- **Claude** is an example of **Long-context models**
- **GPT-4o** is an example of **Long-context models**

_Hub canonical:_ https://memory.wiki/hub/memorywiki-demo
_Concept digest:_ https://memory.wiki/raw/hub/memorywiki-demo?digest=1&compact=1
