Pool search
Pool search finds the tables, columns, and fields that hold the data a question needs, before any SQL is written. A Workspace’s Pools can hold hundreds of tables and thousands of columns, and names such as status, name, and type repeat across them. Pool search exists so Ponder uses the exact names instead of guessing them or reading the whole catalog. It searches the available data, meaning the names, descriptions, and types of tables and columns. It never searches rows. Questions about what records say, such as which calls mentioned a pricing concern, are Row search (search_everything), not Pool search.
One SQL table function does the search: search_available_data. It covers both Pools: the Workspace Pool, workspace.<table>, which holds members, roles, connected Providers and their connections, Preferences, and the non-secret settings of each connected Provider; and the Provider Pool, providers.<schema>.<table>, which holds the data synced from connected Providers. The schema is the Provider’s name, or for a database connection the name the Workspace gave it, such as providers.fusion. It takes up to three arguments, by position only: query, then scope, then kind. The query is plain text describing the data you want. The optional scope is a dotted pattern whose first part picks the Pool: providers.* or workspace.. providers.jiracloud (or providers.jiracloud.) is everything from one Provider, providers..issues is one table name across Providers, providers.jiracloud.issues. is the columns of one table, and workspace.providers.* is the columns of one Workspace table. With no scope, both Pools are searched. The optional kind is ‘table’ or ‘column’. Pass NULL to skip scope and still set kind. Run a search like any other SQL, with Preview a Plot, the operation that runs one query and returns its rows without saving a Report.
workspace.providers, workspace.provider_connections, workspace.stream_data, and workspace.provider_refusals. Every other Workspace table remains unknown. Provider Pools Reader reaches only the Provider Pools, so a workspace scope finds nothing for that role. A Plot cannot call search_available_data: saving one records an error on the Plot, and the Plot cannot publish until it is removed. Use a search to find names, then write the Plot’s SQL with those names. A search reads only the current Workspace. A listed table can still be empty.
- Describe the data in plain words, such as issue priority or connected providers, rather than a guessed column name. Prefer the words a table or column would use: they match by keyword everywhere, while a paraphrase such as who is responsible for the ticket finds the assignee only where semantic ranking is on. Search both Pools when the person’s access permits it: people, roles, Provider connections, stream state, and ingestion refusals are in the Workspace Pool, and work data is in the Provider Pool.
- Find the table first. Pass kind ‘table’ to list only tables, as in search_available_data(‘sprints and their dates’, NULL, ‘table’).
- Then find its columns. Scope a second search to the chosen table, such as providers.jiracloud.issues., or to the values inside one column, such as providers.jiracloud.issues.fields., and read description and data_type to tell apart generic names like status or name.
- Keep a LIMIT on every search. Page with ORDER BY score DESC, qualified_name and OFFSET, for example LIMIT 20 OFFSET 20 for the second page; qualified_name breaks ties, so pages do not repeat or skip results. A search returns at most its 500 best results, and WHERE filters only those 500, so narrow with scope rather than WHERE.
- Write the real query with the exact table_ref and column_name the search returned, and run it the same way. Never retype, shorten, pluralize, or unquote a name.
- If nothing fits, rephrase the query with other words a name or description would use, or widen the scope. If a Provider’s data is missing entirely, read
workspace.providers,workspace.provider_connections, andworkspace.stream_datawhen access permits it. For a connected and enabled stream, inspect recent, time-boundedworkspace.provider_refusalsbefore concluding that the Provider returned no data. If the role reaches only the Provider Pool, list it with an empty search and explain that connection diagnostics need Data Access.