bloop icon indicating copy to clipboard operation
bloop copied to clipboard

Support if_not_exist, list_append UpdateExpression functions

Open numberoverzero opened this issue 6 years ago • 1 comments

Building on #136 there are two functions that could be exposed as additional values for ActionType: if_not_exist and list_append

The if_not_exist function is a conditional SET. This should be straightforward:

bloop.actions.if_not_exist("new_value")

The list_append function appends two lists:

# add to end of list
user.aliases = bloop.actions.list_append(User.aliases, ["n0"])

# add to front of list
user.aliases = bloop.actions.list_append(["n0"], User.aliases)

# does this work?  two column references no literals
user.aliases = bloop.actions.list_append(User.some_list, User.other_list)

# what about this? two literals no column references
user.aliases = bloop.actions.list_append(["n0"], ["n/0"])

Keeping in mind that list_append requires two values it may be easier to add if_not_exist for now and tackle list_append when there's a concrete user need to build against.

numberoverzero avatar Jun 08 '19 17:06 numberoverzero

Removing this from the 3.0 milestone, it's up for grabs in the next minor release if anyone is interested.

numberoverzero avatar Oct 12 '19 06:10 numberoverzero