db.Exec Insert with a where not exists clause

This statement works so I know my connection string etc is good:

result, err = db.Exec("INSERT INTO [dbo].[Priority] ([Priority_SHA256]) VALUES ($1), string(cfg.General.PrioritySHA256[:]))

But when I add the WHERE NOT EXISTS clause, I can not figure out how to substitute the value ( see the bold portion in the following:

result, err = db.Exec(“INSERT INTO [dbo].[Priority] ([Priority_SHA256]) VALUES ($1) WHERE NOT EXISTS ( SELECT ‘x’ FROM [dbo].[Priority] WHERE [Priority_SHA256] = string(cfg.General.PrioritySHA256[:]))”, string(cfg.General.PrioritySHA256[:]))

Connecting to a sqlserver db

Did you mean:

INSERT INTO [dbo].[Priority] ([Priority_SHA256]) VALUES ($1) WHERE NOT EXISTS ( SELECT ‘x’ FROM [dbo].[Priority] WHERE [Priority_SHA256] = $1)

I did and tried that but it complains when it gets to the first “WHERE”

Error:(16, 556) expected, got ‘WHERE’