PostGraphile: Ignore Table Names Start ACT - Technical Support Guide
In this comprehensive guide, we'll dive deep into PostGraphile's feature to ignore table names starting with 'ACT', providing context, key concepts, and examples. With a minimum of 800 words, this article aims to offer a detailed understanding of how to use this functionality effectively. At the end of this article, you'll find a summary and relevant references.
Introduction
PostGraphile is an established tool for automatically generating a GraphQL schema from a PostgreSQL database. It offers a wealth of features to customize and extend GraphQL API generation. One such useful feature is the capability to ignore specific tables during the schema generation.
Ignoring Table Names Start With 'ACT'
With PostGraphile, you have the option to ignore tables whose names start with particular prefixes. This is especially useful when you want to exclude certain tables from your GraphQL schema, such as archived or temporary tables.
How to Ignore Table Names
To ignore table names starting with 'ACT', you should use the --ignore-tables or -I command-line option during the PostGraphile initialization:
postgraphile <database-connection-string> -I ACT*
In this example, ACT* denotes that all table names starting with 'ACT' will be ignored. As a result, PostGraphile won't create any schema elements corresponding to those tables.
Key Concepts
Let's take a closer look at the key concepts associated with ignoring table names in PostGraphile:
- Ignored tables: Tables with names starting with the specified prefix (in our case, 'ACT') will not be represented in the GraphQL schema.
- Prefix matching: The ignoring mechanism is based on prefix matching, meaning it will exclude tables that have a name starting with the specified prefix. No partial matching is considered.
- Case sensitivity: In most environments, the prefix matching is case-sensitive, so pay attention to the case of the table names and the prefix while specifying them for ignoring.
Use Cases
Some common use cases where ignoring table names comes in handy are:
- Excluding archived or temporary tables from the GraphQL schema.
- Improving performance by limiting the schema size.
- Enhancing security and control over the API surface.
This article discussed PostGraphile's feature for ignoring table names starting with a specific prefix, enabling you to exclude certain tables from your GraphQL schema. Using the --ignore-tables or -I command-line option, you can specify the prefix to match and omit corresponding tables.