Skip to content

Commit

Permalink
Fix test case failures
Browse files Browse the repository at this point in the history
  • Loading branch information
kaneeldias committed Nov 27, 2023
1 parent 8903e30 commit f10150a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.8.0"
distribution-version = "2201.8.3-20231119-151400-9cb79da7"

[[package]]
org = "ballerina"
Expand Down
9 changes: 6 additions & 3 deletions ballerina/constants.bal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public final DataSourceSpecifics & readonly MYSQL_SPECIFICS = {
constraintViolationErrorMessage: "a foreign key constraint fails",
duplicateEntryErrorMessage: "Duplicate entry",
duplicateKeyStartIndicator: ".Duplicate entry '",
duplicateKeyEndIndicator: "' for key"
duplicateKeyEndIndicator: "' for key",
columnIdentifier: ""
};

public final DataSourceSpecifics & readonly MSSQL_SPECIFICS = {
Expand All @@ -29,7 +30,8 @@ public final DataSourceSpecifics & readonly MSSQL_SPECIFICS = {
constraintViolationErrorMessage: "conflicted with the FOREIGN KEY constraint",
duplicateEntryErrorMessage: "Cannot insert duplicate key",
duplicateKeyStartIndicator: "The duplicate key value is (",
duplicateKeyEndIndicator: ").."
duplicateKeyEndIndicator: ")..",
columnIdentifier: ""
};

public final DataSourceSpecifics & readonly POSTGRESQL_SPECIFICS = {
Expand All @@ -38,5 +40,6 @@ public final DataSourceSpecifics & readonly POSTGRESQL_SPECIFICS = {
constraintViolationErrorMessage: "violates foreign key constraint",
duplicateEntryErrorMessage: "duplicate key value violates unique constraint",
duplicateKeyStartIndicator: "Detail: Key ",
duplicateKeyEndIndicator: " already exists."
duplicateKeyEndIndicator: " already exists.",
columnIdentifier: "\""
};
1 change: 1 addition & 0 deletions ballerina/metadata_types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ public type DataSourceSpecifics record {|
string duplicateEntryErrorMessage;
string duplicateKeyStartIndicator;
string duplicateKeyEndIndicator;
string columnIdentifier;
|};
2 changes: 1 addition & 1 deletion ballerina/sql_client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public isolated client class SQLClient {
columnNames.push(self.escape(self.entityName) + "." + self.escape(fieldMetadata.columnName) + " AS " + self.escape(key));
} else {
// column is in another entity's table
columnNames.push(self.escape(fieldName) + "." + self.escape(fieldMetadata.relation.refField) + " AS \"" + self.escape(fieldName + "." + fieldMetadata.relation.refField) + "\"");
columnNames.push(self.escape(fieldName) + "." + self.escape(fieldMetadata.relation.refField) + " AS " + self.dataSourceSpecifics.columnIdentifier + self.escape(fieldName + "." + fieldMetadata.relation.refField) + self.dataSourceSpecifics.columnIdentifier);
}

}
Expand Down

0 comments on commit f10150a

Please sign in to comment.