Refresh database schema

When your database schema changes, make sure those changes are reflected in Count.

If the tables available to Count through its database credentials change, then you will need to ask Count to fetch the latest schema to see those changes reflected your workspace.

You can always query any table in your database, regardless of whether or not Count has fetched the latest schema.

This "database schema" is in the form of table metadata, and can be refreshed by workspace admins or above.

Option 1: from the connection settings

Select your connection from the workspace home page, then Manage connection. The option to refresh the schema is available near the bottom of the page.

If your database contains a large number of tables, Count may not import all of them. To reduce the number of tables that Count attempts to import, an optional filter may be applied that is applied to the schema of the table.

There are two options for the form of this filter.

  1. Javascript regular expression. This regular expression is applied to the schema of each row of table metadata streamed to Count's servers. For example, to only fetch schema that begin with the text "production", the filter should be ^production. To only fetch schema that end with the text "_prod", the filter should be _prod$.

To test your regular expression, you may want to use a free tool such as RegExr.

  1. Database native expression. This regular expression is applied to the query executed on your database to retrieve the table metadata. As this is applied to the query, not the table metadata stream, this may give improved performance when executing database schema refreshes. However, the regex itself is database dependent (see table below) and may not be as expressive as the JavaScript filter above. The table below, shows how each filter is implemented.

A common difference between JavaScript regex and Database native regexes is that the former will match on substring matches by default, but Database native regexes will match the full string. To perform partial matches in Database native regex, you will need to explicitly add a wildcard parameter (e.g. %).

Database regex engine

Database
Filter implementation
Documentation link

Postgres

schemaName SIMILAR TO <database-regex> in WHERE clause

Redshift

schemaName SIMILAR TO <database-regex> in WHERE clause

Other

Supported soon - watch this space!

Option 2: from a canvas

You can also refresh the schema directly from the canvas by clicking the refresh icon in the data bar.

View the schema refresh status from the icon in the data bar

Last updated