Azure / Azure/azure-functions-sql-extension

Trigger on view (instead of table)

Open
#647 0 comments 0 reactions 0 assignees View on GitHub
enhancement trigger
Dominant language
C#
Stars
130
Forks
71
Avg merge
4d 8h
Merged PRs (30d)
4

Description

Azure Logic Apps consumes this package for the SQL connector functionality, replacing their original connector. The trigger functionality on the original Azure Logic Apps SQL connector was based on a rowversion() column instead of change tracking, and because of this was able to receive data on _views_ where the table with the rowversion() column existed in addition to a singular table with the rowversion() column.
https://learn.microsoft.com/connectors/sql/#when-an-item-is-modified-[deprecated]
https://learn.microsoft.com/sql/t-sql/data-types/rowversion-transact-sql?view=sql-server-ver16

tables:
```
Table A (columns a1, a2, a3, rowversion)
Table B (columns b1, b2, b3, a1)
Table C (columns c1, c2, c3, b1)
```

view definition:
```
select * from Table A join Table B join Table C
```

When the trigger on the view fires, it has an object input that includes attributes for the contents of Tables A, B, and C. The trigger is only fired by changes to Table A.

The workaround to query multiple tables after a trigger on a single table is undesirable because it introduces latency for roundtrips between the database and app layer.

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked Logic Apps SQL connector and rowversion documentation, then trace the SQL trigger implementation in this repository. Confirm how triggers currently select tables and handle views. Done means a view joining multiple tables can trigger from changes to the rowversion-bearing table while returning the joined view data without application-layer round trips.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, sql
Domain
backend-api-design, cloud, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.