Skip to content

Conversation

lucyzhang929
Copy link
Contributor

Fixes #411

@chlafreniere
Copy link
Contributor

@lucyzhang929 @Charles-Gagnon is this something that we'd like to get in for the next release?

@Charles-Gagnon
Copy link
Contributor

Yeah, I think we should, if anything just to have as much time as possible with people using it.

this.StartFunctionHost(nameof(AddProductParams), lang, false, null, environmentVariables);

// Change database collation to case sensitive
this.ExecuteNonQuery($"ALTER DATABASE {this.DatabaseName} SET Single_User WITH ROLLBACK IMMEDIATE; ALTER DATABASE {this.DatabaseName} COLLATE Latin1_General_CS_AS; ALTER DATABASE {this.DatabaseName} SET Multi_User;");
Copy link
Contributor

Choose a reason for hiding this comment

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

We should still have tests that :

  1. Verify a case sensitive database can be used without error (at least one for each binding type)
  2. Using incorrect casing for a column name throws an error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will open a separate PR to add the tests in all languages since this PR is quite large already

@chlafreniere
Copy link
Contributor

@dzsquared want to make sure you see this PR as a heads up

@lucyzhang929 lucyzhang929 marked this pull request as draft December 6, 2022 16:30
@lucyzhang929
Copy link
Contributor Author

While working on the tests in Java, I noticed an input binding with mismatched cases is passing when I expected it to fail. Converting this to draft for now while I re-investigate what was the exact json error I was seeing previously.

@lucyzhang929 lucyzhang929 marked this pull request as ready for review December 6, 2022 20:25
@lucyzhang929
Copy link
Contributor Author

Discussed offline - for Java Input Bindings if the casing does not match, there is no error thrown but the mismatched field is returned with default values (ex. all Product objects will be returned with {"ProductID": 0} since it doesn't match "ProductId").

- Currently, there is an error for the IEnumerable. We'll fix this by creating an Employee class.
- Create a new file and call it 'Employee.cs'
- Paste the below in the file. These are the column names of our SQL table.
- Paste the below in the file. These are the column names of our SQL table. Note that the casing of the Object field names and the table column names must match.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add this note in the other languages docs appropriately.

public class ProductColumnTypes
{
public int ProductID { get; set; }
public int ProductId { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

I have these duplicated in test-outofproc folder as well, probably a good idea to move them to a common project and reference them to avoid these redundant issues, but for now can you please update them there as well, thanks!

@lucyzhang929 lucyzhang929 merged commit f1d4de8 into main Dec 16, 2022
@lucyzhang929 lucyzhang929 deleted the luczhan/casesensitive branch December 16, 2022 23:48
PBBlox pushed a commit to PBBlox/azure-functions-sql-extension that referenced this pull request Apr 6, 2025
…le column names (Azure#560)

* column names case sensitive

* column names case sensitive

* update integration test base

* remove case sensitive test

* update comment

* add casing requirement to readme

* fix casing in js and ps samples

* fix java + js tests

* pr comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revert support for case insensitive comparison of POCO fields and table column names
4 participants