Add "recursive" config option
darrenklein opened this issue · comments
Darren commented
Allow users to set a boolean recursive
config variable, for use in scans/queries.
Any inline option would always override the set value.
Should it default true
or false
?
Gilad Barkan commented
Consider separate ones for scan and query.
…On Tue, 10 Sep 2019, 10:43 pm Darren, ***@***.***> wrote:
Allow users to set a boolean recursive config variable, for use in
scans/queries.
Any inline option would always override the set value.
Should it default true or false?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#27?email_source=notifications&email_token=AANRFJPWSXSHAUAAUAHIQZLQJBLOZA5CNFSM4IVOR372YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKTEDRQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANRFJMRFC3AZ5TXOSH4CM3QJBLOZANCNFSM4IVOR37Q>
.
Gilad Barkan commented
I would default to false.
…On Tue, 10 Sep 2019, 10:43 pm Darren, ***@***.***> wrote:
Allow users to set a boolean recursive config variable, for use in
scans/queries.
Any inline option would always override the set value.
Should it default true or false?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#27?email_source=notifications&email_token=AANRFJPWSXSHAUAAUAHIQZLQJBLOZA5CNFSM4IVOR372YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKTEDRQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANRFJMRFC3AZ5TXOSH4CM3QJBLOZANCNFSM4IVOR37Q>
.
Darren commented
Seems our default behavior for scans and queries is currently set up to not apply and apply the recursive options, respectively -
query.ex
@doc """
Formats the recursive option according to whether the query is a DynamoDB scan or query. (The adapter defaults to recursive fetch in case of the latter but not the former)
"""
def parse_recursive_option(scan_or_query, opts) do
case opts[:page_limit] do
page_limit when (is_integer page_limit) and page_limit > 0 ->
page_limit
page_limit when (is_integer page_limit) and page_limit < 1 ->
raise ArgumentError, message: "#{inspect __MODULE__}.parse_recursive_option/2 error: :page_limit option must be greater than 0."
_ when scan_or_query == :scan ->
# scan defaults to no recursion, opts[:recursive] must equal true to enable it
opts[:recursive] == true
_ when scan_or_query == :query ->
# query defaults to recursion, opts[:recursive] must equal false to disable it
opts[:recursive] != false
end
end
Gilad Barkan commented
Perfect
…On Wed, 11 Sep 2019, 8:38 am Darren, ***@***.***> wrote:
Seems our default behavior for scans and queries is currently set up to
not apply and apply the recursive options, respectively -
query.ex
@doc """
Formats the recursive option according to whether the query is a DynamoDB scan or query. (The adapter defaults to recursive fetch in case of the latter but not the former)
"""
def parse_recursive_option(scan_or_query, opts) do
case opts[:page_limit] do
page_limit when (is_integer page_limit) and page_limit > 0 ->
page_limit
page_limit when (is_integer page_limit) and page_limit < 1 ->
raise ArgumentError, message: "#{inspect __MODULE__}.parse_recursive_option/2 error: :page_limit option must be greater than 0."
_ when scan_or_query == :scan ->
# scan defaults to no recursion, opts[:recursive] must equal true to enable it
opts[:recursive] == true
_ when scan_or_query == :query ->
# query defaults to recursion, opts[:recursive] must equal false to disable it
opts[:recursive] != false
end
end
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27?email_source=notifications&email_token=AANRFJMDAWWVG3PACBV2PS3QJDRFPA5CNFSM4IVOR372YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OKX3Y#issuecomment-530361327>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANRFJNTH6CKV66CDL2ZG63QJDRFPANCNFSM4IVOR37Q>
.
Darren commented
@alhambra1 given that we already apply these default behaviors, I'm not sure we need the config option after all. Do you concur?
Gilad Barkan commented
Yes
…On Wed, 11 Sep 2019, 8:41 am Darren, ***@***.***> wrote:
@alhambra1 <https://github.com/alhambra1> given that we already apply
these default behaviors, I'm not sure we need the config option after all.
Do you concur?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27?email_source=notifications&email_token=AANRFJKKXWHCGXNXUU7HUG3QJDRQBA5CNFSM4IVOR372YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OK7QA#issuecomment-530362304>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANRFJJTWXTT5MB5DN3L453QJDRQBANCNFSM4IVOR37Q>
.