mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Contributes to DOCS-1052 ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Resolves MDX linting errors related to "simple" where it applies. There was a couple cases that did not apply. For example, a product with "Simple" in the name. These changes are made in context, either by removing or using a more descriptive synonym like "minimal" or "basic". ## Tophatting 1. Read each of the diffs. 2. See that the text still makes sense in context. For extra due diligence, you can run `pnpm lint:mdx` locally and see the 'simple' errors that remain and whether they are worth addressing. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **Documentation** * Updated many guide, tutorial, and troubleshooting pages with clearer “basic”/“minimal” wording across setup steps, local testing instructions, security cautions, and RLS guidance. * Refined headings, example descriptions, and inline comments for consistency (including deployment, MCP, metrics API, and search/function phrasing). * Improved readability with small snippet formatting tweaks (whitespace plus import/comment ordering) and added a self-hosting debugging note for Envoy admin endpoints via a short-lived `curl` container. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Chris Chinchilla <chris.ward@supabase.io> Co-authored-by: Nik Richers <nrichers@gmail.com>
77 lines
3.3 KiB
Plaintext
77 lines
3.3 KiB
Plaintext
---
|
|
id: 'testing-emails-locally'
|
|
title: 'Testing and linting'
|
|
description: 'Using the CLI to test your Supabase project.'
|
|
subtitle: 'Using the CLI to test your Supabase project.'
|
|
---
|
|
|
|
The Supabase CLI provides a set of tools to help you test and lint your Postgres database and Edge Functions.
|
|
|
|
## Testing your database
|
|
|
|
The Supabase CLI provides Postgres linting using the `supabase test db` command.
|
|
|
|
{/* prettier-ignore */}
|
|
```markdown
|
|
supabase test db --help
|
|
Tests local database with pgTAP
|
|
|
|
Usage:
|
|
supabase test db [flags]
|
|
```
|
|
|
|
This is powered by the [pgTAP](/docs/guides/database/extensions/pgtap) extension. You can find a full guide to writing and running tests in the [Testing your database](/docs/guides/database/testing) section.
|
|
|
|
### Test helpers
|
|
|
|
Our friends at [Basejump](https://usebasejump.com/) have created a useful set of Database [Test Helpers](https://github.com/usebasejump/supabase-test-helpers), with an accompanying [blog post](https://usebasejump.com/blog/testing-on-supabase-with-pgtap).
|
|
|
|
### Running database tests in CI
|
|
|
|
Use our GitHub Action to [automate your database tests](/docs/guides/deployment/ci/testing).
|
|
|
|
## Testing your Edge Functions
|
|
|
|
Edge Functions are powered by Deno, which provides a [native set of testing tools](https://deno.land/manual@v1.35.3/basics/testing). We extend this functionality in the Supabase CLI. You can find a detailed guide in the [Edge Functions section](/docs/guides/functions/unit-test).
|
|
|
|
## Testing Auth emails
|
|
|
|
The Supabase CLI uses [Mailpit](https://github.com/axllent/mailpit) to capture emails sent from your local machine. This is useful for testing emails sent from Supabase Auth.
|
|
|
|
### Accessing Mailpit
|
|
|
|
By default, Mailpit is available at [localhost:54324](http://localhost:54324) when you run `supabase start`. Open this URL in your browser to view the emails.
|
|
|
|
### Going into production
|
|
|
|
The "default" email provided by Supabase is only for development purposes. It is [heavily restricted](/docs/guides/platform/going-into-prod#auth-rate-limits) to ensure that it is not used for spam. Before going into production, configure your own email provider by enabling SMTP credentials in your [project settings](/dashboard/project/_/auth/smtp).
|
|
|
|
## Linting your database
|
|
|
|
The Supabase CLI provides Postgres linting using the `supabase db lint` command:
|
|
|
|
{/* prettier-ignore */}
|
|
```markdown
|
|
supabase db lint --help
|
|
Checks local database for typing error
|
|
|
|
Usage:
|
|
supabase db lint [flags]
|
|
|
|
Flags:
|
|
--level [ warning | error ] Error level to emit. (default warning)
|
|
--linked Lints the linked project for schema errors.
|
|
-s, --schema strings List of schema to include. (default all)
|
|
```
|
|
|
|
This is powered by [plpgsql_check](https://github.com/okbob/plpgsql_check), which leverages the internal Postgres parser/evaluator so you see any errors that would occur at runtime. It provides the following features:
|
|
|
|
- validates you are using the correct types for function parameters
|
|
- identifies unused variables and function arguments
|
|
- detection of dead code (any code after an `RETURN` command)
|
|
- detection of missing `RETURN` commands with your Postgres function
|
|
- identifies unwanted hidden casts, which can be a performance issue
|
|
- checks `EXECUTE` statements against SQL injection vulnerability
|
|
|
|
Check the Reference Docs for [more information](/docs/reference/cli/supabase-db-lint).
|