Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for triggers and associated functions #68

Merged
merged 15 commits into from
May 10, 2022
Merged

Conversation

jsynacek
Copy link
Contributor

@jsynacek jsynacek commented Apr 1, 2022

No description provided.

@jsynacek jsynacek marked this pull request as draft April 1, 2022 11:00
@jsynacek jsynacek force-pushed the jsynacek-triggers branch 4 times, most recently from f3fe2c0 to b02fb04 Compare April 7, 2022 12:14
@jsynacek jsynacek force-pushed the jsynacek-triggers branch 2 times, most recently from 5caf926 to 3a44e59 Compare April 12, 2022 08:23
@jsynacek jsynacek changed the title WIP: Initial support for defining triggers Add support for triggers and associated functions Apr 12, 2022
@jsynacek jsynacek requested a review from arybczak April 12, 2022 08:24
@jsynacek jsynacek marked this pull request as ready for review April 12, 2022 08:25
src/Database/PostgreSQL/PQTypes/Checks.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Checks.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
test/Main.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
test/Main.hs Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
@jsynacek jsynacek requested a review from arybczak April 13, 2022 10:18
test/Main.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Checks.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
@jsynacek jsynacek requested a review from arybczak May 3, 2022 10:30
jsynacek added 7 commits May 4, 2022 15:21
* Remove superfluous semicolon
* Remove Eq instance for Trigger
* Compare WHEN clauses in a similar manner as CHECKs are compared
* Use do blocks instead of variable shadowing
* Use unsafeSQL instead of fromString
* Update TODO with issue link
* Add dropTrigger
* CreateTriggerMigration Trigger should not exit. It should be just a function that can be
  added to any StandardMigration
* Rewrite tests using createTrigger and StandardMigration and add more tests for
  dropTrigger as well
@jsynacek jsynacek force-pushed the jsynacek-triggers branch from 1bf9462 to c7faa21 Compare May 4, 2022 16:01
test/Main.hs Outdated Show resolved Hide resolved
@jsynacek jsynacek requested a review from marco44 May 9, 2022 11:34
Copy link

@marco44 marco44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved to the best of my capabilities, which is not a lot in haskell :)

Copy link
Collaborator

@arybczak arybczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 I added 3 minor comments.

src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
src/Database/PostgreSQL/PQTypes/Model/Trigger.hs Outdated Show resolved Hide resolved
jsynacek and others added 3 commits May 10, 2022 09:14
Co-authored-by: Andrzej Rybczak <arybczak@users.noreply.github.com>
Co-authored-by: Andrzej Rybczak <arybczak@users.noreply.github.com>
@jsynacek jsynacek merged commit a3f59aa into master May 10, 2022
@jsynacek jsynacek deleted the jsynacek-triggers branch May 10, 2022 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants