Skip to content

Commit

Permalink
Fix date/time literals.
Browse files Browse the repository at this point in the history
  • Loading branch information
cincuranet committed Jan 28, 2025
1 parent ecc76e1 commit 9b74519
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ protected override string GenerateNonNullSqlLiteral(object value)
switch (_fbDbType)
{
case FbDbType.TimeStamp:
return $"CAST('{value:yyyy-MM-dd HH:mm:ss.ffff}' AS TIMESTAMP)";
return $"CAST('{value:yyyy-MM-dd HH\\:mm\\:ss.ffff}' AS TIMESTAMP)";
case FbDbType.Date:
return $"CAST('{value:yyyy-MM-dd}' AS DATE)";
case FbDbType.Time:
return $"CAST('{value:HH:mm:ss.ffff}' AS TIME)";
return $"CAST('{value:HH\\:mm\\:ss.ffff}' AS TIME)";
default:
throw new ArgumentOutOfRangeException(nameof(_fbDbType), $"{nameof(_fbDbType)}={_fbDbType}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected FbTimeOnlyTypeMapping(RelationalTypeMappingParameters parameters)

protected override string GenerateNonNullSqlLiteral(object value)
{
return $"CAST('{value:HH:mm:ss.ffff}' AS TIME)";
return $"CAST('{value:HH\\:mm\\:ss.ffff}' AS TIME)";
}

protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override string GenerateNonNullSqlLiteral(object value)
switch (_fbDbType)
{
case FbDbType.Time:
return $"CAST('{value:hh\\:mm\\:ss\\.ffff}' AS TIME)";
return $"CAST('{value:hh\\:mm\\:ss.ffff}' AS TIME)";
default:
throw new ArgumentOutOfRangeException(nameof(_fbDbType), $"{nameof(_fbDbType)}={_fbDbType}");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>
<!-- EFCore -->
<PropertyGroup>
<EFCoreProviderVersion>12.0.0-beta1</EFCoreProviderVersion>
<EFCoreProviderVersion>12.0.0-beta2</EFCoreProviderVersion>
<EFCoreReferenceProviderVersion>10.3.2</EFCoreReferenceProviderVersion>
<EFCoreReferencePackageVersion>9.0.1</EFCoreReferencePackageVersion>
</PropertyGroup>
Expand Down

0 comments on commit 9b74519

Please sign in to comment.