Add support for security barrier and invoker#453
Open
calebhearth wants to merge 4 commits intomainfrom
Open
Conversation
07acb6d to
bf13464
Compare
Postgres accepts arguments in the form `WITH (<option>[ = <true|false>])`, so
rather than manually extending the various APIs to accept them individually
let's take a `with: {...}` argument that can take in arbitrary values.
The argument handling is:
- `false` or `null` values are discarded as the default behavior
- `true` values are passed as `<option> = true`
- other String or Symbol values are passed as `<option> = <value>`
This provides a more extensible API that can support any PostgreSQL view option
without requiring changes to Scenic's code, as evidence has shown that Derek and
I aren't super responsive maintainers. This should allow extensibility with new
Postgres (and other) features without requiring one of us to add support for
them.
A drawback and/or strength of this approach is that maintainers of Scenic
adapters such as MySQL or SQLite[^pronunciation] will have to deal with the
`with` hash individually, and that it may break migrations between databases. I
suspect that the latter is (a). unlikely to ever come up and (b). the least of the
worries of developers who undertake this.
- Add parse_view_options helper to generically parse PostgreSQL reloptions
[^pronunciation]: I just want to call out that "SQLite" is intended to be
pronounced as rhyming with meteorite and not with blight because I think that's
fun.
Conventional: Feat
Feat: Allow `with` argument to *_view to be passed to view DDL statements
Conventional: BREAKING CHANGE
Breaking: Users of the #433 fork will
need to adjust their arguments slightly.
bf13464 to
93b39f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Postgres accepts arguments in the form
WITH (<option>[ = <true|false>]), sorather than manually extending the various APIs to accept them individually
let's take a
with: {...}argument that can take in arbitrary values.The argument handling is:
falseornullvalues are discarded as the default behaviortruevalues are passed as<option> = true<option> = <value>This provides a more extensible API that can support any PostgreSQL view option
without requiring changes to Scenic's code, as evidence has shown that Derek and
I aren't super responsive maintainers. This should allow extensibility with new
Postgres (and other) features without requiring one of us to add support for
them.
A drawback and/or strength of this approach is that maintainers of Scenic
adapters such as MySQL or SQLite1 will have to deal with the
withhash individually, and that it may break migrations between databases. Isuspect that the latter is (a). unlikely to ever come up and (b). the least of the
worries of developers who undertake this.
Conventional: Feat
Feat: Allow
withargument to *_view to be passed to view DDL statementsConventional: BREAKING CHANGE
Breaking: Users of the #433 fork will
need to adjust their arguments slightly.
Closes: #433
Closes: #432
Footnotes
I just want to call out that "SQLite" is intended to be
pronounced as rhyming with meteorite and not with blight because I think that's
fun. ↩