fsprojects / AzureStorageTypeProvider

An F# Azure Type Provider which can be used to explore Blob, Table and Queue Azure Storage assets and easily apply CRUD operations on them.
http://fsprojects.github.io/AzureStorageTypeProvider/
The Unlicense
84 stars 34 forks source link

#35 Added async variants for table members #76

Closed stewart-r closed 8 years ago

stewart-r commented 8 years ago

Fixes #35

I think I have now covered all the table members with async variants.

As always, just let me know if there is something I ought to amend or rethink.

Stewart

isaacabraham commented 8 years ago

Thanks again :-)

stewart-r commented 8 years ago

My pleasure. (literally! ;-))

isaacabraham commented 7 years ago

@stewart-r just a small question regarding the above - I'm thinking of rewriting this bit recursively / with a fold but I'm unclear of the behaviour of the continuation token. Does it mutate the exist token (in which case does it really set it to null?) or should there be a "new" token passed out?

stewart-r commented 7 years ago

Oh no - that's a mistake.

getBatch should returnbatch.ContinuationToken - not the original contTkn. It should have been:

let getBatch contTkn = async {
        let! batch = (getTable tableName connection).ExecuteQuerySegmentedAsync(query,contTkn) |> Async.AwaitTask
        batch 
        |> Seq.map(mapToReturnEntity)
        |> resSet.AddRange
        return batch.ContinuationToken
    } 
let! firstContTkn = getBatch null
let mutable contTkn = firstContTkn
while (contTkn <> null) do
     let! nextTkn = getBatch contTkn
     contTkn <- nextTkn

Sincere apologies, Isaac. I should have spotted this but, more importantly, I should have had this covered by a test. It never occurred to me that I didn't have a multi-batch test.

isaacabraham commented 7 years ago

No worries :-) I'll push a fix out - code hasn't been released yet anyway.

isaacabraham commented 7 years ago

Would you have time to write a multi-batch test though? :-)

stewart-r commented 7 years ago

Certainly - its the least I can do. :-)

I'm just starting work right now but will either do it at lunchtime or this evening

isaacabraham commented 7 years ago

That's great - I've pushed the fix, so no rush on the test case. Thanks for your help here :-)