Chalk supports Spanner as a natively accelerated SQL source.

Adding Spanner

Follow the GCP instructions to give Chalk access to application credentials for your GCP account. Chalk will use these credentials to access Spanner. On the dashboard, you can plug in the configuration for your Spanner database:

Add Spanner

Add a Spanner integration. These parameters will also be available as environment variables.

Spanner
Environment

Learn more about Chalk's Spanner Integration

Integrations Setup

After configuring your Spanner integration in the dashboard, define your data sources in Python:

from chalk.sql import SpannerSource

spanner_source_txns = SpannerSource(name="SPANNER_TRANSACTIONS")
spanner_source_marketing = SpannerSource(name="SPANNER_MARKETING")

Then reference them in SQL file resolvers using the name parameter. For example, to query from the SPANNER_TRANSACTIONS source:

-- type: online
-- resolves: User
-- source: SPANNER_TRANSACTIONS
SELECT
    id,
    TransactionVolume AS transaction_volume
FROM
    UserTable

And to query from the SPANNER_MARKETING source:

-- type: online
-- resolves: User
-- source: SPANNER_MARKETING
SELECT
    id,
    email,
    campaign_status
FROM
    MarketingTable