Files
supabase/apps/studio/components/interfaces/Database/Triggers/Triggers.constants.ts
Joshen Lim dd03625f55 Chore/refactor triggers to remove mobx (#35254)
* Set up create trigger

* Hook up update trigger

* Deprecate CreateTrigger

* Small clean up DeleteTrigger

* Update apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2025-04-28 11:33:37 +08:00

47 lines
1.3 KiB
TypeScript

export const TRIGGER_EVENTS = [
{ value: 'INSERT', label: 'Insert', description: 'Any insert operation on the table' },
{
value: 'UPDATE',
label: 'Update',
description: 'Any update operation of any column on the table',
},
{ value: 'DELETE', label: 'Delete', description: 'Any delete operation of a record' },
]
export const TRIGGER_TYPES = [
{
value: 'BEFORE',
label: 'Before the event',
description: 'Trigger fires before the operation is attempted',
},
{
value: 'AFTER',
label: 'After the event',
description: 'Trigger fires before the operation has completed',
},
]
export const TRIGGER_ORIENTATIONS = [
{
value: 'ROW',
label: 'Row',
description: 'Fires once for each processed row',
},
{
value: 'STATEMENT',
label: 'Statement',
description: 'Fires once for each statement',
},
]
export const TRIGGER_ENABLED_MODES = [
{ value: 'ORIGIN', label: 'Origin', description: 'This is the default behaviour' },
{
value: 'REPLICA',
label: 'Replica',
description: 'Will only fire if the session is in "replica" mode',
},
{ value: 'ALWAYS', label: 'Always', description: 'Will fire regardless of the replication role' },
{ value: 'DISABLED', label: 'Disabled', description: 'Will not fire' },
]