graphql-engine/docs
Karthikeyan Chinnakonda 32a316aef7 server: provide an option to enable event triggers on logically replicated tables
## Description ✍️
This PR introduces a new feature to enable/disable event triggers during logical replication of table data for PostgreSQL and MS-SQL data sources. We introduce a new field `trigger_on_replication` in the `*_create_event_trigger` metadata API. By default the event triggers will not fire for logical data replication.

## Changelog ✍️

__Component__ : server

__Type__: feature

__Product__: community-edition

### Short Changelog

Add option to enable/disable event triggers on logically replicated tables

### Related Issues ✍

https://github.com/hasura/graphql-engine/issues/8814
https://hasurahq.atlassian.net/browse/GS-252

### Solution and Design
- By default, triggers do **not** fire when the session mode is `replica` in Postgres, so if the `triggerOnReplication` is set to `true` for an event trigger we run the query `ALTER TABLE #{tableTxt} ENABLE ALWAYS TRIGGER #{triggerNameTxt};` so that the trigger fires always irrespective of the `session_replication_role`
- By default, triggers do fire in case of replication in MS-SQL, so if the `triggerOnReplication` is set to `false` for an event trigger we add a clause `NOT FOR REPLICATION` to the the SQL when the trigger is created/altered, which sets the `is_not_for_replication` for the trigger as `true` and it does not fire during logical replication.

### Steps to test and verify ✍
- Run hspec integration tests for HGE

## Server checklist ✍

### Metadata ✍

Does this PR add a new Metadata feature?
-  Yes
  - Does `export_metadata`/`replace_metadata` supports the new metadata added?
    - 

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6953
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: 92731328a2bbdcad2302c829f26f9acb33c36135
2022-11-29 17:43:13 +00:00
..
.yarn/releases Updates Docusaurus to 2.1 2022-11-18 16:02:38 +00:00
docs server: provide an option to enable event triggers on logically replicated tables 2022-11-29 17:43:13 +00:00
public docs: move docs-new to docs 2022-04-13 12:01:50 +00:00
scripts docs: epic restructure 2022-07-20 16:36:00 +00:00
src Docs: Docusaurus update fixes 2022-11-23 07:54:19 +00:00
static console: enable naming convention check to enable/disable naming convention carded radio button 2022-11-28 07:36:27 +00:00
wiki Docs: Wiki add Hasura features and headings info 2022-11-15 16:18:39 +00:00
.dockerignore Build configs for preview builds through GKE 2022-11-23 14:18:37 +00:00
.gitignore Updates Docusaurus to 2.1 2022-11-18 16:02:38 +00:00
.prettierrc.json Updates Docusaurus to 2.1 2022-11-18 16:02:38 +00:00
.yarnrc Updates Docusaurus to 2.1 2022-11-18 16:02:38 +00:00
.yarnrc.yml Updates Docusaurus to 2.1 2022-11-18 16:02:38 +00:00
babel.config.js docs: move docs-new to docs 2022-04-13 12:01:50 +00:00
CONTRIBUTING.md docs: update contributing guides 2022-09-01 13:54:20 +00:00
Dockerfile Build configs for preview builds through GKE 2022-11-23 14:18:37 +00:00
docusaurus.config.js Updates Docusaurus to 2.1 2022-11-18 16:02:38 +00:00
package.json Updates Docusaurus to 2.1 2022-11-18 16:02:38 +00:00
preview_cloud_build.yaml Build configs for preview builds through GKE 2022-11-23 14:18:37 +00:00
README.md Fix broken links 2022-10-26 14:22:19 +00:00
sidebars.js docs: epic restructure 2022-07-20 16:36:00 +00:00
sidebarsWiki.js docs: move docs-new to docs 2022-04-13 12:01:50 +00:00
tsconfig.json docs: move docs-new to docs 2022-04-13 12:01:50 +00:00
yarn.lock Updates Docusaurus to 2.1 2022-11-18 16:02:38 +00:00

README.md

Info

The most up-to-date information for the docs site can be found on our wiki. You can access the wiki on the live docs site, or directly within this repository.