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