Introducing Flights: agent-native data pipelines in MotherDuckJoin the livestream

Skip to main content

Looker with MotherDuck

Preview

The Postgres endpoint is in preview. Features and behavior may change.

Looker (Google Cloud core) connects to MotherDuck through the Postgres endpoint using its standard PostgreSQL dialect. A Looker-specific compatibility mode is required so that symmetric aggregates and Persistent Derived Tables (PDTs) work correctly.

Before you start

You'll need:

Connect to MotherDuck

In Looker, go to Admin → Connections → Add Connection and configure:

ParameterValue
DialectPostgreSQL 9.5+
HostYour MotherDuck Postgres host (for example, pg.us-east-1-aws.motherduck.com)
Port5432
DatabaseYour MotherDuck database name
Usernamepostgres
PasswordYour MotherDuck access token (see Choose the right token)
SSLEnabled
Verify SSLDisabled, unless your Looker instance is configured for certificate verification
Additional JDBC Parametersoptions=--compatibility-mode=looker
Looker database and authentication settings for a MotherDuck Postgres endpoint connection

In Optional Settings, enable SSL and Database Connection Pooling. Leave Verify SSL disabled unless your Looker instance is configured to verify the server certificate.

Looker optional settings with SSL and database connection pooling enabled

After configuring the connection, click Test these settings. The test runs against MotherDuck and produces a known cancellation warning that is safe to ignore (see Connection test behavior). Click Add Connection to save.

Required: compatibility mode parameter

You must set the following in the Additional JDBC Parameters field:

options=--compatibility-mode=looker

This parameter does two important things:

  • Enables symmetric aggregates
  • Enables Persistent Derived Table (PDT) support

Without it, symmetric aggregate queries return incorrect results and PDT builds fail.

Enable connection pooling

Enable database connection pooling in Looker's connection settings. DuckDB is optimized for large analytical queries rather than high volumes of short concurrent connections, so pooling reduces connection overhead and improves overall stability. This is the recommended configuration for MotherDuck.

Choose the right token

MotherDuck supports two token types. Choose based on how your Looker deployment will use the connection:

Token typeUse whenNotes
Read scaling tokenReporting / BI usage with many concurrent users (reads only)Recommended for the main Looker connection when PDT writes are not needed on this connection.
Read/write tokenPDT builds, or any connection that needs to write tablesLooker supports configuring a separate PDT connection — you can use a read/write token there while keeping a read scaling token on the main connection.

Connection test behavior

When you run Looker's built-in connection test, you may see a warning that query cancellation does not work. This is expected and can be safely ignored. The warning is produced because the test cancellation query itself fails due to memory consumption — not because the cancellation mechanism is broken. Production query cancellation is unaffected.

Troubleshooting

SymptomResolution
Symmetric aggregate queries fail or return incorrect resultsEnsure options=--compatibility-mode=looker is set in Additional JDBC Parameters.
PDT build fails or Explore intermittently errorsCheck Admin → PDT → PDT Details for build status and last SQL. Confirm the table exists in your MotherDuck scratch schema.
Connection test shows cancellation warningExpected behavior. The warning appears only during the test query and does not affect production query cancellation.

Additional information