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 missing MustSql methods #288

Merged
merged 1 commit into from Jun 4, 2021
Merged

Add missing MustSql methods #288

merged 1 commit into from Jun 4, 2021

Conversation

swithek
Copy link
Contributor

@swithek swithek commented Jun 3, 2021

MustSql() method on SelectBuilder tends to be quite useful when working with less dynamic queries, however, at the moment, it's not possible to have the same flow with queries made with CaseBuilder, DeleteBuilder, InsertBuilder and UpdateBuilder. This PR adds MustSql() method to all of them.

Related PR: #156

@swithek
Copy link
Contributor Author

swithek commented Jun 3, 2021

It seems CI errors are unrelated to this PR.

@lann
Copy link
Member

lann commented Jun 3, 2021

I wonder if it would make sense to have a single function MustSql(s Sqlizer) (string, []interface{}) 🤔

@swithek
Copy link
Contributor Author

swithek commented Jun 3, 2021

Yes, that probably makes sense considering the number of possible SQL operations. However, my current implementation follows the same chaining logic as other methods do, which might feel more intuitive.

@swithek
Copy link
Contributor Author

swithek commented Jun 3, 2021

Besides, there's already a MustSql method on SelectBuilder which can't be removed. Having the same MustSql method on all main builders would make everything look more consistent.

@swithek
Copy link
Contributor Author

swithek commented Jun 4, 2021

@lann do you have more thoughts on this?

@lann lann merged commit cd1fe0a into Masterminds:master Jun 4, 2021
@lann
Copy link
Member

lann commented Jun 4, 2021

Send reasonable and consistent

kodiakhq bot pushed a commit to cloudquery/cq-provider-sdk that referenced this pull request Jun 20, 2022
)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/Masterminds/squirrel](https://togithub.com/Masterminds/squirrel) | require | patch | `v1.5.0` -> `v1.5.3` |

---

### Release Notes

<details>
<summary>Masterminds/squirrel</summary>

### [`v1.5.3`](https://togithub.com/Masterminds/squirrel/compare/v1.5.2...v1.5.3)

[Compare Source](https://togithub.com/Masterminds/squirrel/compare/v1.5.2...v1.5.3)

### [`v1.5.2`](https://togithub.com/Masterminds/squirrel/releases/tag/v1.5.2)

[Compare Source](https://togithub.com/Masterminds/squirrel/compare/v1.5.1...v1.5.2)

#### What's Changed

-   [#&#8203;301](https://togithub.com/Masterminds/squirrel/issues/301) Conjunction produces wrong dollar parameter placeholders by [@&#8203;strider2038](https://togithub.com/strider2038) in [Masterminds/squirrel#302

### [`v1.5.1`](https://togithub.com/Masterminds/squirrel/releases/tag/v1.5.1)

[Compare Source](https://togithub.com/Masterminds/squirrel/compare/v1.5.0...v1.5.1)

#### What's Changed

-   doc: fix deprecated usage of NewStmtCache by [@&#8203;elvizlai](https://togithub.com/elvizlai) in [Masterminds/squirrel#274
-   Add missing MustSql methods by [@&#8203;swithek](https://togithub.com/swithek) in [Masterminds/squirrel#288
-   Fix Select subquery with DollarPlaceholder by [@&#8203;lann](https://togithub.com/lann) in [Masterminds/squirrel#298

#### New Contributors

-   [@&#8203;swithek](https://togithub.com/swithek) made their first contribution in [Masterminds/squirrel#288

**Full Changelog**: Masterminds/squirrel@v1.5.0...v1.5.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate).
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.

None yet

2 participants