You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
RawSql.Insert cannot be used as entire Where clause or Set clause in UpdateDataExpression/DeleteDataExpression
To Reproduce
[Migration(202406181031,"Testing RawSql.Insert behavior")]publicclassTestMigration:ForwardOnlyMigration{publicoverridevoidUp(){
Update.Table("Foo").InSchema("dbo").Set(RawSql.Insert("Baz = CASE WHEN Bar = 1 THEN 2 ELSE 0 END")).Where(RawSql.Insert("Baz IS NULL"));}}
generates the following invalid SQL expression:
UPDATE [dbo].[Foo] SET [Value] = N'Baz = CASE WHEN Bar = 1 THEN 2 ELSE 0 END'WHERE [Value] = N'Baz IS NULL'
Expected behavior
RawSql should be... raw sql :)
Information (please complete the following information):
FluentMigrator version 5.2.0
Additional context
Workaround is to use Execute.Sql syntax instead:
[Migration(202406181031,"Testing RawSql.Insert behavior")]publicclassTestMigration:ForwardOnlyMigration{publicoverridevoidUp(){
Execute.Sql(@"UPDATE dbo.FooSET Baz = CASE WHEN Bar = 1 THEN 2 ELSE 0 ENDWHERE Baz IS NULL");}}
The text was updated successfully, but these errors were encountered:
Describe the bug
RawSql.Insert cannot be used as entire Where clause or Set clause in UpdateDataExpression/DeleteDataExpression
To Reproduce
generates the following invalid SQL expression:
Expected behavior
RawSql should be... raw sql :)
Information (please complete the following information):
Additional context
Workaround is to use Execute.Sql syntax instead:
The text was updated successfully, but these errors were encountered: