INSERT INTO contacts(
  account_id,
  alias,
  color,
  contact_id,
  created_time,
  display_name,
  email,
  external,
  favorite,
  note,
  permission,
  phone_number,
  presence_emoji,
  presence_idle,
  presence_idle_time,
  presence_login_time,
  presence_message,
  presence_mobile,
  presence_notifications_disabled,
  presence_primitive,
  sid,
  time_zone
)
VALUES (
  :_account_id,
  :alias,
  :color,
  :_contact_id,
  :created_time,
  :display_name,
  :email,
  :external,
  :favorite,
  :note,
  :permission,
  :phone_number,
  :presence_emoji,
  :presence_idle,
  :presence_idle_time,
  :presence_login_time,
  :presence_message,
  :presence_mobile,
  :presence_notifications_disabled,
  :presence_primitive,
  :sid,
  :time_zone
)
ON CONFLICT(account_id, contact_id)
DO UPDATE SET
  alias=:alias,
  color=:color,
  created_time=:created_time,
  display_name=:display_name,
  email=:email,
  external=:external,
  favorite=:favorite,
  note=:note,
  permission=:permission,
  phone_number=:phone_number,
  presence_emoji=:presence_emoji,
  presence_idle=:presence_idle,
  presence_idle_time=:presence_idle_time,
  presence_login_time=:presence_login_time,
  presence_message=:presence_message,
  presence_mobile=:presence_mobile,
  presence_notifications_disabled=:presence_notifications_disabled,
  presence_primitive=:presence_primitive,
  sid=:sid,
  time_zone=:time_zone
