Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion java-library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library-sql</artifactId>
<version>2.0.0-preview</version> <!-- Update the dependency version in samples-java/pom.xml and test-java/pom.xml if this version is updated. -->
<version>2.1.0-preview</version> <!-- Update the dependency version in samples-java/pom.xml and test-java/pom.xml if this version is updated. -->
<packaging>jar</packaging>

<parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* Text or Stored Procedure.
*/
CommandType commandType();
CommandType commandType() default CommandType.Text;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Text as default to be consistent with other languages.


/**
* Parameters to the query or stored procedure. This string must follow the format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@
* Setting name for SQL connection string.
*/
String connectionStringSetting();

/**
* Optional. Name of the table used to store leases. If not specified, the leases table name will be
* Leases_{FunctionId}_{TableId}. More information on how this is generated can be found here:
* https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleases_).
*/
String leasesTableName() default "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

package com.function;

import com.microsoft.azure.functions.ExecutionContext;
import com.microsoft.azure.functions.annotation.FunctionName;
import com.microsoft.azure.functions.sql.annotation.SQLTrigger;
import com.function.Common.SqlChangeProduct;
import com.google.gson.Gson;

import java.util.logging.Level;

public class ProductsTriggerLeasesTableName {
@FunctionName("ProductsTriggerLeasesTableName")
public void run(
@SQLTrigger(
name = "changes",
tableName = "[dbo].[Products]",
connectionStringSetting = "SqlConnectionString",
leasesTableName = "Leases")
SqlChangeProduct[] changes,
ExecutionContext context) {

context.getLogger().log(Level.INFO, "SQL Changes: " + new Gson().toJson(changes));
}
}