Skip to content
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@
Sql.Append(" AS ");
if (sqlParameterExpression.Type == typeof(string))
{
var storeTypeNameBase = sqlParameterExpression.TypeMapping.StoreTypeNameBase;
var size = sqlParameterExpression.TypeMapping.Size;
var isUnicode = FbTypeMappingSource.IsUnicode(sqlParameterExpression.TypeMapping);
Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringParameterQueryType(isUnicode));

Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringParameterQueryType(isUnicode, storeTypeNameBase, size));

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EFCore-Functional)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EF6)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EFCore-Functional)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EFCore-Functional)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EFCore)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EF6)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EFCore)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Embedded)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EFCore)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Embedded)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Embedded)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EF6)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EF6)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EFCore-Functional)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EFCore-Functional)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EFCore)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EF6)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EFCore)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EFCore-Functional)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Embedded)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EFCore)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EF6)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Embedded)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Embedded)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 3: cannot convert from 'int?' to 'int'

Check failure on line 176 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 3: cannot convert from 'int?' to 'int'
}
else
{
Expand All @@ -191,9 +194,16 @@
base.VisitSqlConstant(sqlConstantExpression);
if (shouldExplicitStringLiteralTypes)
{
var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping);
var storeTypeNameBase = sqlConstantExpression.TypeMapping.StoreTypeNameBase;
var size = sqlConstantExpression.TypeMapping.Size;
var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping);

Sql.Append(" AS ");
Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(sqlConstantExpression.Value as string, isUnicode));
Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(
sqlConstantExpression.Value as string,
isUnicode,
storeTypeNameBase,
size));

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EFCore-Functional)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EF6)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EFCore-Functional)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EFCore-Functional)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EFCore)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EF6)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EFCore)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Embedded)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EFCore)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Embedded)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Embedded)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EF6)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EF6)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EFCore-Functional)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EFCore-Functional)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EFCore)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EF6)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-NoCompression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EFCore)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-EFCore-Functional)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Embedded)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-EFCore)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-EF6)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Embedded)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Embedded)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB40, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-NoCompression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB50, Tests-FirebirdClient-Default-Compression-CryptDisabled)

Argument 4: cannot convert from 'int?' to 'int'

Check failure on line 206 in src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs

View workflow job for this annotation

GitHub Actions / ci (FB30, Tests-FirebirdClient-Default-Compression-CryptRequired)

Argument 4: cannot convert from 'int?' to 'int'
Sql.Append(")");
}
return sqlConstantExpression;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,38 @@ public FbSqlGenerationHelper(RelationalSqlGenerationHelperDependencies dependenc
: base(dependencies)
{ }

public virtual string StringLiteralQueryType(string s, bool isUnicode = true)
public virtual string StringLiteralQueryType(string s, bool isUnicode = true, string storeTypeNameBase = "", int size = 0)
{
var length = MinimumStringQueryTypeLength(s);
var maxSize = MinimumStringQueryTypeLength(s);
string typeName;
if (storeTypeNameBase.Equals("BLOB SUB_TYPE TEXT", StringComparison.OrdinalIgnoreCase))
{
typeName = "VARCHAR";
}
else
{
typeName = IsEmpty(storeTypeNameBase) ? "VARCHAR" : storeTypeNameBase;
}

var charset = isUnicode ? " CHARACTER SET UTF8" : string.Empty;
return $"VARCHAR({length}){charset}";
return $"{typeName}({maxSize}){charset}";
}

public virtual string StringParameterQueryType(bool isUnicode)
public virtual string StringParameterQueryType(bool isUnicode, string storeTypeNameBase = "", int size = 0)
{
var size = isUnicode ? FbTypeMappingSource.UnicodeVarcharMaxSize : FbTypeMappingSource.VarcharMaxSize;
return $"VARCHAR({size})";
int maxSize;
string typeName;
if (storeTypeNameBase.Equals("BLOB SUB_TYPE TEXT", StringComparison.OrdinalIgnoreCase))
{
maxSize = (isUnicode ? FbTypeMappingSource.UnicodeVarcharMaxSize : FbTypeMappingSource.VarcharMaxSize);
typeName = "VARCHAR";
}
else
{
maxSize = size > 0 ? size : (isUnicode ? FbTypeMappingSource.UnicodeVarcharMaxSize : FbTypeMappingSource.VarcharMaxSize);
typeName = IsEmpty(storeTypeNameBase) ? "VARCHAR" : storeTypeNameBase;
}
return $"{typeName}({maxSize})";
}

public virtual void GenerateBlockParameterName(StringBuilder builder, string name)
Expand All @@ -47,17 +68,16 @@ public virtual void GenerateBlockParameterName(StringBuilder builder, string nam

public virtual string AlternativeStatementTerminator => "~";

static int MinimumStringQueryTypeLength(string s)
private int MinimumStringQueryTypeLength(string s)
{
var length = s?.Length ?? 0;
if (length == 0)
length = 1;
return length;
}

static void EnsureStringLiteralQueryTypeLength(int length)
private bool IsEmpty(string storeTypeNameBase)
{
if (length > FbTypeMappingSource.UnicodeVarcharMaxSize)
throw new ArgumentOutOfRangeException(nameof(length));
return (storeTypeNameBase == null || string.IsNullOrEmpty(storeTypeNameBase) || string.IsNullOrWhiteSpace(storeTypeNameBase));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal;

public interface IFbSqlGenerationHelper : ISqlGenerationHelper
{
string StringLiteralQueryType(string s, bool isUnicode);
string StringParameterQueryType(bool isUnicode);
string StringLiteralQueryType(string s, bool isUnicode, string storeTypeNameBase = "", int size = 0);
string StringParameterQueryType(bool isUnicode, string storeTypeNameBase = "", int size = 0);
void GenerateBlockParameterName(StringBuilder builder, string name);
string AlternativeStatementTerminator { get; }
}
Loading