Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions FSharp.AWS.DynamoDB.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=fffffffzzz/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=hkey/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=topt/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
7 changes: 5 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 0.13.0-beta
* Updated `AWSSDK.DynamoDBv2` dependency to `4.0.10.4` [#86](https://github.com/fsprojects/FSharp.AWS.DynamoDB/pull/86).
* (breaking) NOTE [the underlying dependency change may trigger breaking changes to your application](https://docs.aws.amazon.com/sdk-for-net/v4/developer-guide/net-dg-v4.html) that can impact your application either as compile-time errors (if your system has low-level calls not using this library), or runtime exceptions (if you have external logic that falls foul of the V4 SDK changed `List`/`Dictionary` behavior)
### 0.12.3-beta
* Removed erroneous `Dotnet.Reproduciblebuilds` dependency [#75](https://github.com/fsprojects/FSharp.AWS.DynamoDB/pull/75)
### 0.12.2-beta
Expand Down Expand Up @@ -48,7 +51,7 @@

### 0.9.4-beta
* Moved Sync-over-Async versions of `TableContext` operations into `namespace FSharp.AWS.DynamoDB.Scripting`
* Added `WithMetricsCollector()` copy method to allow separating metrics by context (eg by request)
* Added `WithMetricsCollector()` copy method to allow separating metrics by context (e.g. by request)
* Ensured metrics are reported even for failed requests
* Added `TryGetItemAsync` (same as `GetItemAsync`, but returns `None`, instead of throwing, if an item is not present)
* Switched test framework to Xunit, assertions to Unquote, runner to `dotnet test`
Expand All @@ -75,7 +78,7 @@
### 0.8.1-beta
* Replace deprecated AWS ProfileManager usage
* Bumped test project netcoreapp version to 3.1
* Fixed 'Invalid UpdateExpression' exception for precomputed Map.remove operations (#20)
* Fixed 'Invalid UpdateExpression' exception for precomputed `Map.remove` operations (#20)

### 0.8.0-beta
* Move to netstandard2.0.
Expand Down
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nuget Unquote ~> 6.1.0
# Also avoids Rider search finding stuff in FSharp.Core.xml
nuget FSharp.Core >= 4.7.2 content: false, lowest_matching: true

nuget AWSSDK.DynamoDBv2 ~> 3.7.5
nuget AWSSDK.DynamoDBv2 ~> 4

github eiriktsarpalis/TypeShape:10.0.0 src/TypeShape/TypeShape.fs

Expand Down
43 changes: 34 additions & 9 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ STORAGE: NONE
RESTRICTION: || (== net8.0) (== netstandard2.0) (== netstandard2.1)
NUGET
remote: https://api.nuget.org/v3/index.json
AWSSDK.Core (3.7.300.11)
Microsoft.Bcl.AsyncInterfaces (>= 1.1) - restriction: || (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
AWSSDK.DynamoDBv2 (3.7.300.11)
AWSSDK.Core (>= 3.7.300.11 < 4.0)
AWSSDK.Core (4.0.3.6)
Microsoft.Bcl.AsyncInterfaces (>= 8.0) - restriction: || (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Memory (>= 4.5.5) - restriction: || (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Text.Json (>= 8.0.5) - restriction: || (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
AWSSDK.DynamoDBv2 (4.0.10.4)
AWSSDK.Core (>= 4.0.3.6 < 5.0)
DotNet.ReproducibleBuilds (1.1.1) - copy_local: true
Microsoft.SourceLink.AzureRepos.Git (>= 1.1.1)
Microsoft.SourceLink.Bitbucket.Git (>= 1.1.1)
Microsoft.SourceLink.GitHub (>= 1.1.1)
Microsoft.SourceLink.GitLab (>= 1.1.1)
FSharp.Core (4.7.2)
Microsoft.Bcl.AsyncInterfaces (8.0) - restriction: || (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
Microsoft.Bcl.AsyncInterfaces (10.0.1) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Threading.Tasks.Extensions (>= 4.6.3) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
Microsoft.Build.Tasks.Git (8.0) - copy_local: true
Microsoft.SourceLink.AzureRepos.Git (8.0) - copy_local: true
Microsoft.Build.Tasks.Git (>= 8.0)
Expand All @@ -28,9 +31,31 @@ NUGET
Microsoft.SourceLink.GitLab (8.0) - copy_local: true
Microsoft.Build.Tasks.Git (>= 8.0)
Microsoft.SourceLink.Common (>= 8.0)
System.Runtime.CompilerServices.Unsafe (6.0) - restriction: || (&& (== net8.0) (>= net461)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (&& (== net8.0) (< netstandard1.0)) (&& (== net8.0) (< netstandard2.0)) (&& (== net8.0) (>= wp8)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
System.Threading.Tasks.Extensions (4.5.4) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netcoreapp2.1)) (&& (== net8.0) (< netstandard1.0)) (&& (== net8.0) (< netstandard2.0)) (&& (== net8.0) (>= wp8)) (== netstandard2.0) (== netstandard2.1)
System.Buffers (4.6.1) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.IO.Pipelines (10.0.1) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Buffers (>= 4.6.1) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Memory (>= 4.6.3) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Threading.Tasks.Extensions (>= 4.6.3) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Memory (4.6.3) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Buffers (>= 4.6.1) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
System.Numerics.Vectors (>= 4.6.1) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
System.Runtime.CompilerServices.Unsafe (>= 6.1.2) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
System.Numerics.Vectors (4.6.1) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
System.Runtime.CompilerServices.Unsafe (6.1.2) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Text.Encodings.Web (10.0.1) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Buffers (>= 4.6.1) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Memory (>= 4.6.3) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Runtime.CompilerServices.Unsafe (>= 6.1.2) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Text.Json (10.0.1) - restriction: || (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
Microsoft.Bcl.AsyncInterfaces (>= 10.0.1) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Buffers (>= 4.6.1) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.IO.Pipelines (>= 10.0.1)
System.Memory (>= 4.6.3) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Runtime.CompilerServices.Unsafe (>= 6.1.2) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Text.Encodings.Web (>= 10.0.1)
System.Threading.Tasks.Extensions (>= 4.6.3) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Threading.Tasks.Extensions (4.6.3) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (>= net472)) (&& (== net8.0) (< netcoreapp3.1)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1)
System.Runtime.CompilerServices.Unsafe (>= 6.1.2) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462))
Unquote (6.1)
FSharp.Core (>= 4.7.2)
GITHUB
Expand Down
32 changes: 16 additions & 16 deletions src/FSharp.AWS.DynamoDB/Expression/ConditionalExpr.fs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ let extractKeyCondition (qExpr: QueryExpr) =
| None ->
hk.KeySchemata
|> Array.tryPick (function
| (ks, KeyType.Hash) -> Some ks
| ks, KeyType.Hash -> Some ks
| _ -> None)
| Some rk ->
Seq.joinBy (fun (ks, kt) (ks', kt') -> kt = KeyType.Hash && kt' = KeyType.Range && ks = ks') hk.KeySchemata rk.KeySchemata
Expand All @@ -163,7 +163,7 @@ let ensureNotTautological query =
let extractQueryExpr (recordInfo: RecordTableInfo) (expr: Expr) : ConditionalExpression =
if not expr.IsClosed then
invalidArg "expr" "supplied query is not a closed expression."
let invalidQuery () = invalidArg "expr" <| sprintf "Supplied expression is not a valid conditional."
let invalidQuery () = invalidArg "expr" "Supplied expression is not a valid conditional."

let nParams, (|PVar|_|), expr' = extractExprParams recordInfo expr

Expand Down Expand Up @@ -233,12 +233,12 @@ let extractQueryExpr (recordInfo: RecordTableInfo) (expr: Expr) : ConditionalExp
let (|Comparison|_|) (pat: Expr) (expr: Expr) =
match expr with
| SpecificCall pat (None, _, args) ->
let pickler = args |> List.tryPick (|AttributeGet|_|) |> Option.map (fun attr -> attr.Pickler)
let pickler = args |> List.tryPick (|AttributeGet|_|) |> Option.map _.Pickler
let operands = args |> List.map (extractOperand pickler)
let pickler =
match pickler with
| Some p -> p
| None -> Pickler.resolveUntyped args.[0].Type
| None -> Pickler.resolveUntyped args[0].Type
Some(pickler, operands)

| _ -> None
Expand Down Expand Up @@ -354,7 +354,7 @@ let applyParams (cond: ConditionalExpression) (inputValues: obj[]) =
let applyOperand (op: Operand) =
match op with
| Param(i, pickler) ->
match pickler.PickleCoerced inputValues.[i] with
match pickler.PickleCoerced inputValues[i] with
| Some av -> Value(wrap av)
| None -> Undefined

Expand Down Expand Up @@ -396,27 +396,27 @@ let applyParams (cond: ConditionalExpression) (inputValues: obj[]) =

/// prints a query expression to string recognizable by the DynamoDB APIs
let writeConditionExpression (writer: AttributeWriter) (cond: ConditionalExpression) =
let sb = new System.Text.StringBuilder()
let sb = System.Text.StringBuilder()
let inline (!) (p: string) = sb.Append p |> ignore
let inline writeOp o =
match o with
| Undefined -> invalidOp "internal error: attempting to reference undefined value in query expression."
| Param _ -> invalidOp "internal error: attempting to reference parameter value in query expression."
| Value v -> !(writer.WriteValue(unwrap v))
| Attribute a -> !(writer.WriteAttibute a)
| Attribute a -> !(writer.WriteAttribute a)
| SizeOf a ->
! "( size ( "
!(writer.WriteAttibute a)
!(writer.WriteAttribute a)
! " ))"

let writeOps (ops: Operand array) =
if ops.Length = 1 then
writeOp ops.[0]
writeOp ops[0]
else
for i = 0 to ops.Length - 2 do
writeOp ops.[i]
writeOp ops[i]
! ", "
writeOp ops.[ops.Length - 1]
writeOp ops[ops.Length - 1]


let inline writeCmp cmp =
Expand Down Expand Up @@ -464,23 +464,23 @@ let writeConditionExpression (writer: AttributeWriter) (cond: ConditionalExpress
! " )"
| BeginsWith(attr, op) ->
! "( begins_with ( "
!(writer.WriteAttibute attr)
!(writer.WriteAttribute attr)
! ", "
writeOp op
! " ))"
| Contains(attr, op) ->
! "( contains ( "
!(writer.WriteAttibute attr)
!(writer.WriteAttribute attr)
! ", "
writeOp op
! " ))"
| Attribute_Exists attr ->
! "( attribute_exists ( "
!(writer.WriteAttibute attr)
!(writer.WriteAttribute attr)
! "))"
| Attribute_Not_Exists attr ->
! "( attribute_not_exists ( "
!(writer.WriteAttibute attr)
!(writer.WriteAttribute attr)
! "))"
| In(op, ops) ->
! "("
Expand Down Expand Up @@ -524,7 +524,7 @@ type ConditionalExpression with
| None -> None

member cond.GetDebugData() =
let aw = new AttributeWriter()
let aw = AttributeWriter()
let expr = writeConditionExpression aw cond
let names = aw.Names |> Seq.map (fun kv -> kv.Key, kv.Value) |> Seq.toList
let values = aw.Values |> Seq.map (fun kv -> kv.Key, kv.Value.Print()) |> Seq.toList
Expand Down
Loading