# Supabase
> Supabase is a Postgres platform for building applications with a managed database, APIs, authentication, storage, and realtime features. Supabase's documented DuckDB Wrapper can query MotherDuck from a Supabase Postgres database through a foreign data wrapper.
## How it works with MotherDuck

1. Enable the Supabase Wrappers extension.
2. Create the `duckdb_wrapper` foreign data wrapper.
3. Store a MotherDuck token in Supabase Vault, then create a foreign server with `type 'md'`, the MotherDuck database name, and the Vault-backed token option.
4. Create a schema for the foreign tables.
5. Import a MotherDuck schema, such as `main`, into Supabase and query the imported foreign tables from Postgres.

```sql
create extension if not exists wrappers with schema extensions;

create foreign data wrapper duckdb_wrapper
  handler duckdb_fdw_handler
  validator duckdb_fdw_validator;

create server duckdb_server_md
  foreign data wrapper duckdb_wrapper
  options (
    type 'md',
    database 'my_db',
    vault_motherduck_token '<vault_secret_id>'
  );

create schema if not exists duckdb;

import foreign schema "main"
  from server duckdb_server_md into duckdb;

select *
from duckdb.my_table
limit 10;
```

The Supabase DuckDB Wrapper is a read path into MotherDuck: it supports querying foreign tables, including `where`, `order by`, and `limit` pushdown, but does not support inserts, updates, deletes, or truncates through the foreign tables.

## Related content

- [View the full process in the Supabase DuckDB Wrapper documentation](https://supabase.com/docs/guides/database/extensions/wrappers/duckdb)
- [MotherDuck authentication](/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck)
- [PostgreSQL and MotherDuck](/integrations/databases/postgres)


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `POST https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

Payload:

```json
{
  "page_path": "/integrations/databases/supabase/",
  "page_title": "Supabase",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed payloads, and `429` when rate-limited.
