Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Output binding column requirements to known issues #907

Merged
merged 2 commits into from
Aug 17, 2023
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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Supported SQL Server Versions](#supported-sql-server-versions)
- [Known Issues](#known-issues)
- [Known/By Design Issues](#knownby-design-issues)
- [Output Bindings](#output-bindings)
- [Telemetry](#telemetry)
- [Privacy Statement](#privacy-statement)
- [Trademarks](#trademarks)

## Introduction
Expand Down Expand Up @@ -38,9 +39,11 @@ This extension uses the [OPENJSON](https://learn.microsoft.com/sql/t-sql/functio

Databases on SQL Server, Azure SQL Database, or Azure SQL Managed Instance which meet the compatibility level requirement above are supported.

## Known Issues
## Known/By Design Issues

> **Note:** While we are actively working on resolving these issues, some may not be supported at this time. We appreciate your patience as we work to improve the Azure Functions SQL Extension.
Below is a list of common issues that users may run into when using the SQL Bindings extension.

> **Note:** While we are actively working on resolving the known issues, some may not be supported at this time. We appreciate your patience as we work to improve the Azure Functions SQL Extension.

- **By Design:** The table used by a SQL binding cannot contain two columns that only differ by casing (Ex. 'Name' and 'name').
- **By Design:** Non-CSharp functions using SQL bindings against tables with columns of data types `BINARY` or `VARBINARY` need to map those columns to a string type. Input bindings will return the binary value as a base64 encoded string. Output bindings require the value upserted to binary columns to be a base64 encoded string.
Expand All @@ -57,6 +60,7 @@ Databases on SQL Server, Azure SQL Database, or Azure SQL Managed Instance which
- Have multiple functions, with dependent functions being triggered by the initial functions (through a trigger binding or other such method)
- Use [dynamic (imperative)](https://learn.microsoft.com/azure/azure-functions/functions-bindings-expressions-patterns#binding-at-runtime) bindings (.NET only)
- Use [IAsyncCollector](https://learn.microsoft.com/azure/azure-functions/functions-dotnet-class-library?tabs=v2%2Ccmd#writing-multiple-output-values) and call `FlushAsync` in the order desired (.NET only)
- **By Design:** Output bindings require that their payloads contain ALL columns defined in every execution, even optional ones. See [BindingsOverview.md#output-binding-columns](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/BindingsOverview.md#output-binding-columns) for more details
- **Planned for Future Support:** For PowerShell Functions that use hashtables must use the `[ordered]@` for the request query or request body assertion in order to upsert the data to the SQL table properly. An example can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/main/samples/samples-powershell/AddProductsWithIdentityColumnArray/run.ps1).
- **Planned for Future Support:** Java, PowerShell, and Python Functions using Output bindings cannot pass in null or empty values via the query string.
- Java: Issue is tracked [here](https://github.com/Azure/azure-functions-java-worker/issues/683).
Expand Down
2 changes: 2 additions & 0 deletions docs/BindingsOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ When generating the queries used to upsert values into the database, the binding

The result is that the binding expects all objects to have every column defined - even optional columns. If this is not the case then it will likely result in some column values being ignored if they aren't included in the first item in the row. Optional columns should pass a null value (or the language equivalent) in rows that don't have a value for that column.

Failure to do this may result in unexpected behavior, such as columns in requests being ignored or Exceptions being thrown.

### Primary Key Special Cases

Typically Output Bindings require two things :
Expand Down