Skip to main content

Use the SQL editor

Discover tables, run a safe read-only query, return to saved SQL, and export the results you need.

Open SQL Editor in the organization whose data you want to analyze. The editor requires both execute SQL (sql.execute) and view data (data.view) access. Exporting the full query result additionally requires export data (data.export) access.

These permissions are separate from creating or revealing an external database connection string. External credentials also require Full giving access; see Accessing Your Data for that setup.

Queries on Giving tables also depend on your Giving level. None refuses Giving queries. Summary permits aggregate results but blocks SELECT *, row-identifying columns, individual donor fields and row-serialization functions. Full removes these Giving-level restrictions; SQL and data permissions still apply. See access and giving permissions.

Run a safe first query

Enter this query in a query tab and select Run:

SELECT 1 AS connection_check;

A successful result contains one row with connection_check equal to 1. This checks query execution without reading person or giving information. If access is denied, ask your team manager to review the grants for the current organization rather than changing organizations to reach different data.

Discover tables and columns

The editor provides table and column autocomplete. Use the Planning Center schema reference to understand the data before writing joins, or run this read-only catalogue query to see available table names:

SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_schema = 'planning_center'
ORDER BY table_name
LIMIT 20;

See Planning Center Overview for source tables and relationship rules. Add a small LIMIT while exploring, choose the columns you need, and constrain dates before running a large report. When joining external identifiers, include the source instance so records from different connections cannot be mistaken for the same person or group.

Read results and errors

Review the returned columns, rows, and result count. A page of results or a sample is not necessarily the complete result set; read the footer before using a displayed row count as a total.

When a query is running, Cancel requests cancellation. A failed query shows an error; fix the query or access problem before treating an empty result as evidence that no data exists. If your session expires, sign in again and confirm the organization before continuing.

Save SQL and return to it

  1. Use the Save query icon beside the query tabs.
  2. Enter a Name and, optionally, a Description, then save.
  3. Open Saved in the editor sidebar to load it again.

When a tab is linked to a saved query, the icon becomes Update saved query. Review your edits before updating the saved SQL. Use Search queries... to find saved work or the supplied report queries; History lets you return to earlier executions.

Loading saved SQL or history into a tab does not by itself make its old results current. Run the query and check its outcome when you need a fresh answer.

Export the right result set

After a successful query, open Export above the result table:

  • Download current page exports the loaded page of rows.
  • If some columns are hidden, the menu offers Download visible columns and Download all columns for that page.
  • Download all records exports the full query result when a direct download is supported. Email all records queues a background export for larger results or when the total count is not yet known.

The all-records export uses the query, not just the rows already displayed. Wait for its completion or email before treating a queued job as a delivered file. Review the exported columns and the information your access permits before sharing it.

For an external client or BI tool, follow Accessing Your Data instead of trying to use editor permissions as a connection string.

On this page