Skip to content

Commit

Permalink
inserting into postgres SQL was broken
Browse files Browse the repository at this point in the history
The output keyword doesn't exist in postgre. Fixed it with the returning syntax
  • Loading branch information
paule96 authored Aug 27, 2024
1 parent 014c71f commit 2b87690
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public void InsertResource(LocalizationResource resource)
conn.Open();

var cmd = new NpgsqlCommand(
@"INSERT INTO public.""LocalizationResources"" (""ResourceKey"", ""Author"", ""FromCode"", ""IsHidden"", ""IsModified"", ""ModificationDate"", ""Notes"") OUTPUT INSERTED.ID VALUES (@resourceKey, @author, @fromCode, @isHidden, @isModified, @modificationDate, @notes)",
@"INSERT INTO public.""LocalizationResources"" (""ResourceKey"", ""Author"", ""FromCode"", ""IsHidden"", ""IsModified"", ""ModificationDate"", ""Notes"") VALUES (@resourceKey, @author, @fromCode, @isHidden, @isModified, @modificationDate, @notes) RETURNING ""LocalizationResources"".""Id""",
conn);

cmd.Parameters.AddWithValue("resourceKey", resource.ResourceKey);
Expand Down

0 comments on commit 2b87690

Please sign in to comment.