Turso
Connect
Connect Turso from the terminal. Pass --help for the flags Turso accepts, plus --no-browser for headless environments.
polylane cloud connect --provider tursoA platform API token from your Turso account settings or the Turso CLI.
Turso connects with a platform API token:
- Open Turso, go to your account settings' API Tokens page, or run
turso auth api-tokens mint polylanefrom the CLI. - Copy the platform API token.
- Paste the token into Polylane. If the token can reach more than one organization, pick the one to connect when prompted.
- Polylane validates the token and starts syncing.
Each connection covers a single Turso organization. Polylane discovers its database groups and databases, including locations, placement, branching parentage, and read/write status. Tokens are encrypted before they are stored, and the agent never sees them. Polylane reads the Platform API only; it never connects to your databases and never holds database credentials.
Turso's Platform API reports usage as cumulative billing-period counters rather than time series, so databases carry no metric charts. Monitoring polls those counters and watches the deltas instead: read and write volume, sync traffic, storage growth, database count, quota burn against your plan, and the heaviest queries per database are each checked against the account's own history.
Troubleshooting
"Invalid Turso API token" error
- Platform API tokens are different from database auth tokens; mint one with
turso auth api-tokens mintor from your account settings. - Check that the token has not been revoked in Turso's settings.
"Multiple Turso organizations are reachable" error
- The token can reach more than one organization, so name the one to connect.
- Connecting in the console, pick the organization when prompted after validation.
- Connecting via the API, set the
organizationfield to the organization slug.
Missing resources
- Turso can take a few minutes to sync everything.
- Trigger a manual Sync from the account header to refresh.
Disconnecting
Disconnect the account in Polylane, then revoke the API token from your Turso account settings or with turso auth api-tokens revoke.
Connect Turso from a CI job or any other environment without a browser.
Connecting Turso needs no browser: the same endpoint the console calls fits in a CI job. One authenticated POST creates the connection and starts the first sync.
Prerequisites
- A Polylane API key with the
cloud_accounts:writeandcloud_accounts:readscopes. See API keys and OAuth. - Your workspace ID, which starts with
ws_. Read it fromGET /v1/workspaceswith the same key. - A Turso platform API token, minted from your account settings or with
turso auth api-tokens mint polylane.
Create the connection
curl -X POST https://api.polylane.com/v1/cloud_accounts \
-H "x-api-key: $POLYLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "turso",
"workspaceId": "ws_0abc123",
"token": "<platform-api-token>",
"organization": "my-org-slug"
}'
One call connects one Turso organization.
organizationmay be omitted only when the token reaches exactly one organization; otherwise the call fails with a400that lists the reachable organization slugs.
The response lists what was connected, with the first sync already running. Trimmed to the two fields the rest of the flow reads:
{
"success": true,
"result": {
"provider": "turso",
"accounts": [{ "id": "acc_34gky74ibc92h8t2efn8csrh", "status": "syncing" }],
"failures": []
}
}
An account that is already connected lands in failures instead of accounts, so repeating the call never duplicates a connection.
Wait for the first sync
Poll each returned account by its id until status reaches ready (new on registration, syncing while resources stream in):
until [ "$(curl -s "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY" | jq -r '.result.status')" = "ready" ]; do
sleep 15
done
Give the loop a deadline so a failed connect fails the job instead of hanging it. Once the account is ready, its resources are in the topology and Polylane has started its first check.
Disconnect from the API
Deleting the connection stops every sync and check and deletes the credentials Polylane held. The call needs the cloud_accounts:delete scope:
curl -X DELETE "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY"
Then revoke the Turso credential on the provider side, as described under Disconnect below.
Disconnect
Disconnecting stops every sync and check and deletes the credentials Polylane held. Everything Polylane set up in Turso is removed as well; nothing is left behind.
polylane cloud disconnect <id>Supported resources
2Resource types that show up in your infrastructure graph.