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

user/favorite: use sqlc for user favorites #3288

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

mastercactapus
Copy link
Member

@mastercactapus mastercactapus commented Sep 19, 2023

Description:
This PR focuses on converting the user/favorite package to use sqlc queries. I have updated the store methods to accept a database interface (sql.DB or sql.Tx) as an argument rather than using an embedded database. This is a standard PR that is part of a larger effort to migrate to sqlc queries, as outlined in issues #3108 and #3235.

Which issue(s) this PR fixes:
Fixes part of #3235

Out of Scope:
No additional features or fixes are included that are not directly related to the issue #3235.

Screenshots:
N/A (Not a user-facing change)

Describe any introduced user-facing changes:
None. This change is behind-the-scenes and does not affect the user experience.

Describe any introduced API changes:
No API changes. The store methods now accept a database interface as an argument, but this is not user-facing.

Additional Info:
This PR is one of many that are working towards migrating GoAlert to use sqlc queries.

@mastercactapus mastercactapus merged commit 53b2e35 into master Oct 11, 2023
6 checks passed
@mastercactapus mastercactapus deleted the convert-fav-store-to-sqlc branch October 11, 2023 19:52
andrewbenington added a commit that referenced this pull request Oct 17, 2023
commit 6f17c75
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 17 08:44:00 2023 -0700

    build(deps-dev): bump @mui/x-data-grid from 6.16.1 to 6.16.2 (#3364)

    Bumps [@mui/x-data-grid](https://github.com/mui/mui-x/tree/HEAD/packages/grid/x-data-grid) from 6.16.1 to 6.16.2.
    - [Release notes](https://github.com/mui/mui-x/releases)
    - [Changelog](https://github.com/mui/mui-x/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/mui/mui-x/commits/v6.16.2/packages/grid/x-data-grid)

    ---
    updated-dependencies:
    - dependency-name: "@mui/x-data-grid"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 4affe40
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 17 08:43:03 2023 -0700

    build(deps): bump @babel/traverse from 7.22.20 to 7.23.2 (#3367)

    Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.20 to 7.23.2.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

    ---
    updated-dependencies:
    - dependency-name: "@babel/traverse"
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 1209194
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 17 08:41:19 2023 -0700

    build(deps-dev): bump @types/react-transition-group from 4.4.6 to 4.4.7 (#3363)

    Bumps [@types/react-transition-group](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-transition-group) from 4.4.6 to 4.4.7.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-transition-group)

    ---
    updated-dependencies:
    - dependency-name: "@types/react-transition-group"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 53c1c7e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 16 12:22:54 2023 -0700

    build(deps): bump google.golang.org/grpc from 1.58.2 to 1.58.3 (#3366)

    Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.2 to 1.58.3.
    - [Release notes](https://github.com/grpc/grpc-go/releases)
    - [Commits](grpc/grpc-go@v1.58.2...v1.58.3)

    ---
    updated-dependencies:
    - dependency-name: google.golang.org/grpc
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 48d08f2
Author: Nathaniel Caza <mastercactapus@gmail.com>
Date:   Fri Oct 13 11:31:51 2023 -0500

    increase variance in delayminutes (#3359)

commit 4b95ef8
Author: Lakshmi2107 <32451441+Lakshmi2107@users.noreply.github.com>
Date:   Fri Oct 13 20:45:00 2023 +0530

    add partial search for description (#3195)

    * add partial search for description

    * add contains func

    * escape contains search

    ---------

    Co-authored-by: Lakshmi V <lakshmi.v@lowes.com>
    Co-authored-by: Nathaniel Caza <mastercactapus@gmail.com>

commit 3671734
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Oct 12 11:04:33 2023 -0500

    build(deps): bump golang.org/x/net from 0.16.0 to 0.17.0 (#3360)

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.16.0 to 0.17.0.
    - [Commits](golang/net@v0.16.0...v0.17.0)

    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 190c9e5
Author: Katie Sydlik-Badgerow <38022260+KatieMSB@users.noreply.github.com>
Date:   Wed Oct 11 16:34:07 2023 -0400

    ui/service-metrics: service metrics hooks (#3300)

    * add new hook and worker

    * clean up useServiceMetrics

    * add comments

    * use specific type as metric keys

    * update useServiceMetrics hook and add filtering

    * update search to include maintenance mode

commit 53b2e35
Author: Nathaniel Caza <mastercactapus@gmail.com>
Date:   Wed Oct 11 14:52:30 2023 -0500

    use sqlc for user favorites (#3288)

commit 2ed8e6f
Author: Nathaniel Caza <mastercactapus@gmail.com>
Date:   Tue Oct 10 15:47:00 2023 -0500

    dev: Update Go 1.21.3 and deps (#3356)

    * update go to 1.21.3

    * update go deps

    * make generate

    ---------

    Co-authored-by: Nathaniel Cook <nathanieljcook@outlook.com>

commit 41754c3
Author: Leya Salazar <96083374+leyasalazar@users.noreply.github.com>
Date:   Tue Oct 10 14:23:12 2023 -0500

    Add Webhook Documentation Links to UI (#3294)

    * working on formField file

    * webhook documentation link

    * delete id from url

    * removed changes to the forms files

    * Update web/src/app/escalation-policies/PolicyStepForm.js

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

    * remove more innecesary changes from form conversion work

    * extra line web/src/app/util/NumberField.tsx

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

    * extra line web/src/app/util/MountWatcher.js

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

    * extra line web/src/app/users/UserContactMethodForm.tsx

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

    * extra line web/src/app/forms/Form.js

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

    * extra line web/src/app/forms/FormContainer.js

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

    * extra line web/src/app/forms/FormField.js

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

    * extra line web/src/app/forms/context.js

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

    * remove id

    * open in new tab

    * support linking to doc section

    * link directly to webhook section in new tab

    * fix comment

    ---------

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    Co-authored-by: Nathaniel Caza <mastercactapus@gmail.com>

commit 47b35fc
Author: Nathaniel Cook <NathanielJCook@outlook.com>
Date:   Tue Oct 10 12:18:27 2023 -0700

    alertmetrics: show metrics up to current time, instead of start of bucket (#3345)

    * show alerts to now in graph, update tooltip label

    * show header range properly

    * update headers

    * fix title

commit 5746a5d
Author: Allen Ding <59105963+allending313@users.noreply.github.com>
Date:   Tue Oct 10 15:11:41 2023 -0400

    chore: user contactmethod sqlc (#3310)

    * convert user/contactmethod to use sqlc

    * clean up validations

    * remove unnecessary validation

    * fix bugs from smoketest

    * clean up transactions with dbtx

    * fix transaction logic

    * remove db from cmstore, update query prefixes

    * remove unecessary newstore func

    ---------

    Co-authored-by: AllenDing <Allen.Ding@target.com>
    Co-authored-by: Nathaniel Caza <mastercactapus@gmail.com>

commit 935a72a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Oct 10 11:44:11 2023 -0500

    Bump @apollo/client from 3.8.4 to 3.8.5 (#3352)

    Bumps [@apollo/client](https://github.com/apollographql/apollo-client) from 3.8.4 to 3.8.5.
    - [Release notes](https://github.com/apollographql/apollo-client/releases)
    - [Changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md)
    - [Commits](apollographql/apollo-client@v3.8.4...v3.8.5)

    ---
    updated-dependencies:
    - dependency-name: "@apollo/client"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 4c6a92c
Author: Allen Ding <59105963+allending313@users.noreply.github.com>
Date:   Tue Oct 10 12:07:45 2023 -0400

    feat: add monthly rotations UI (#3257)

    * add monthly rotation ui features

    * fix handoff summary and use new shiftLength field

    * revert unnecessary changes

    * fix hint alignment

    * update hint styling to match form helper text

    * fix ui bugs

    * fix linting

    * fix ui bugs

    * handle rel format in diff. timezone

    * fix cypress test

    * Update web/src/app/rotations/RotationForm.tsx

    Co-authored-by: Nathaniel Caza <mastercactapus@gmail.com>

    ---------

    Co-authored-by: AllenDing <Allen.Ding@target.com>
    Co-authored-by: Nathaniel Caza <mastercactapus@gmail.com>

commit 7e0a73d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 9 16:33:29 2023 -0500

    Bump golang.org/x/sys from 0.12.0 to 0.13.0 (#3350)

    Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.12.0 to 0.13.0.
    - [Commits](golang/sys@v0.12.0...v0.13.0)

    ---
    updated-dependencies:
    - dependency-name: golang.org/x/sys
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Nathaniel Caza <mastercactapus@gmail.com>

commit 8d56ab4
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 9 15:59:37 2023 -0500

    Bump @mui/x-data-grid from 6.14.0 to 6.16.1 (#3346)

    Bumps [@mui/x-data-grid](https://github.com/mui/mui-x/tree/HEAD/packages/grid/x-data-grid) from 6.14.0 to 6.16.1.
    - [Release notes](https://github.com/mui/mui-x/releases)
    - [Changelog](https://github.com/mui/mui-x/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/mui/mui-x/commits/v6.16.1/packages/grid/x-data-grid)

    ---
    updated-dependencies:
    - dependency-name: "@mui/x-data-grid"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Nathaniel Caza <mastercactapus@gmail.com>

commit ca9d2bf
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 9 15:59:27 2023 -0500

    Bump github.com/spf13/viper from 1.16.0 to 1.17.0 (#3348)

    Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.16.0 to 1.17.0.
    - [Release notes](https://github.com/spf13/viper/releases)
    - [Commits](spf13/viper@v1.16.0...v1.17.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/spf13/viper
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Nathaniel Caza <mastercactapus@gmail.com>

commit 952279b
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 9 14:19:29 2023 -0500

    Bump @babel/core from 7.22.20 to 7.23.0 (#3354)

    Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.20 to 7.23.0.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.23.0/packages/babel-core)

    ---
    updated-dependencies:
    - dependency-name: "@babel/core"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit d2c1a5b
Author: Nathaniel Caza <mastercactapus@gmail.com>
Date:   Mon Oct 9 13:45:06 2023 -0500

    fix wrong param (#3355)

commit 15a0cc5
Author: Nathaniel Caza <mastercactapus@gmail.com>
Date:   Fri Oct 6 09:53:06 2023 -0500

    preserve line breaks in markdown (#3344)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants