Skip to main content

Supabase

This connector materializes Estuary collections into tables in a Supabase PostgreSQL database.

Prerequisites

To use this connector, you'll need:

  • A Postgres database in Supabase to materialize into, with user credentials. The connector will create new tables in the database per your specification. Tables created manually in advance are not supported.
  • A Supabase direct connection hostname which bypasses the Supabase connection pooler. See Setup for details.
  • At least one Estuary collection

Setup

You must configure your database to allow connections from Estuary.

By default, Supabase guides users into connecting to their database through a Connection Pooler. Connection poolers are helpful for many applications, but unfortunately the pooler does not work well with temporary tables and prepared statements that this connector relies on.

This materialization connector requires a direct connection address for your database. The address can be found by clicking on the Connect button in your Supabase dashboard. Under the Direct connection option, copy the host and port for your database.

For example, if the provided connection string is postgresql://postgres:[YOUR-PASSWORD]@db.abcdef.supabase.co:5432/postgres, then the address is db.abcdef.supabase.co:5432.

Configuration

To use this connector, begin with data in one or more Estuary collections. Use the below properties to configure a Supabase materialization, which will direct one or more of your Estuary collections to your desired tables, or views, in the database.

Properties

Endpoint

PropertyTitleDescriptionTypeRequired/Default
/addressAddressHost and port of the database. If only the host is specified, port will default to 5432.stringRequired
/userUserDatabase user to connect as.stringRequired
/databaseDatabaseName of the logical database to materialize to.string
/schemaDatabase SchemaDatabase schema to use for materialized tables (unless overridden within the binding resource configuration) as well as associated materialization metadata tablesstring"public"
/hardDeleteHard DeleteIf this option is enabled, items deleted in the source will also be deleted from the destination. Otherwise, _meta/op in the destination will signify whether rows have been deleted (soft-delete).booleanfalse
/advancedAdvanced OptionsOptions for advanced users. You should not typically need to modify these.object
/advanced/sslmodeSSL ModeOverrides SSL connection behavior by setting the 'sslmode' parameter.string
Authentication
PropertyTitleDescriptionTypeRequired/Default
/credentialsAuthenticationAuthentication method and credentials that provide access to the database.objectRequired
/credentials/auth_typeAuth TypeThe authentication method to use. One of UserPassword, AWSIAM, GCPIAM, or AzureIAM.string
/credentials/passwordPasswordPassword for the specified database user.stringRequired for UserPassword auth
/credentials/aws_regionAWS RegionAWS region of your resource.stringRequired for AWSIAM auth
/credentials/aws_role_arnAWS Role ARNAWS role for Estuary to use that has access to the resource.stringRequired for AWSIAM auth
/credentials/gcp_service_account_to_impersonateGCP Service AccountGCP service account email for Cloud SQL IAM authentication.stringRequired for GCPIAM auth
/credentials/gcp_workload_identity_pool_audienceWorkload Identity Pool AudienceGCP workload identity pool audience. The format should be similar to: //iam.googleapis.com/projects/123/locations/global/workloadIdentityPools/test-pool/providers/test-provider.stringRequired for GCPIAM auth
/credentials/azure_client_idAzure Client IDAzure App Registration Client ID for Azure Active Directory authentication.stringRequired for AzureIAM auth
/credentials/azure_tenant_idAzure Tenant IDAzure Tenant ID for Azure Active Directory authentication.stringRequired for AzureIAM auth

Bindings

PropertyTitleDescriptionTypeRequired/Default
/additional_table_create_sqlAdditional Table Create SQLAdditional SQL statement(s) to be run in the same transaction that creates the table.string
/delta_updatesDelta UpdateShould updates to this table be done via delta updates.booleanfalse
/schemaAlternative SchemaAlternative schema for this table (optional). Overrides schema set in endpoint configuration.string
/tableTableTable name to materialize to. It will be created by the connector, unless the connector has previously created it.stringRequired

Sample

materializations:
${PREFIX}/${mat_name}:
endpoint:
connector:
image: ghcr.io/estuary/materialize-supabase-postgres:v5
config:
database: flow
address: db.abcdef.supabase.co:5432
user: flow
credentials:
auth_type: UserPassword
password: <secret>
bindings:
- resource:
table: ${TABLE_NAME}
source: ${PREFIX}/${COLLECTION_NAME}

Delta updates

This connector supports both standard (merge) and delta updates. The default is to use standard updates.

Reserved words

PostgreSQL has a list of reserved words that must be quoted in order to be used as an identifier. Estuary considers all the reserved words that are marked as "reserved" in any of the columns in the official PostgreSQL documentation.

Estuary automatically quotes fields that are in this reserved words list.