-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
hey upsert is great; I ran into the following using it, on the MSSQL grammar:
getInstance("queryBuilder@qb").from("rmme_foo").upsert(
values = {a: 1, b: {value: "", null: true}, c: "some new string value"},
target = ["a","b"],
update = ["c"]
)
generates:
MERGE [rmme_foo] AS [qb_target] USING (VALUES (1, null, 'some new string value')) AS [qb_src] ([A], [B], [C]) ON
[qb_target].[a] = [qb_src].[a] AND
[qb_target].[b] = [qb_src].[b] /* <------ this */
WHEN MATCHED THEN UPDATE SET [c] = [qb_src].[c]
WHEN NOT MATCHED BY TARGET THEN INSERT ([A], [B], [C]) VALUES ([A], [B], [C]);
the line marked <------- this should probably be [qb_target].[b] is null, otherwise it never matches (since null never equals null)
Metadata
Metadata
Assignees
Labels
No labels