Capital icon indicating copy to clipboard operation
Capital copied to clipboard

Spread transfer request over multiple accounts matching a selector

Open SOF3 opened this issue 4 years ago • 0 comments

For example, if we have a database like this:

ID Balance Labels
X01 15 name=X, valueMin=0
X02 15 name=X, valueMin=0
Y03 0 name=Y, valueMax=100

We want to transfer 20 from name=X to name=Y. This is not possible using a single account, but this is possible by splitting the transfer into multiple transactions:

Source Destination Delta
X01 Y03 15
X02 Y03 5

Alternatively:

Source Destination Delta
X01 Y03 10
X02 Y03 10

Whichever strategy we want to use, this is not possible with the current SQL procedures. To implement this with atomic transactions on MySQL, we may need to create a table storing a temporary list of accounts matching a label selector, then perform operations based on this temporary list.

SOF3 avatar Dec 19 '21 07:12 SOF3

I have a similar issue due to this. If you think it's okay, I want to make a PR that adds enum variants Char8, Char16, Char32, and WChar, which correspond to the u8, u, U, and L prefixes.

paxbun avatar Apr 03 '23 08:04 paxbun