code: func CreateDeviceQueueItem(db sqlx.Queryer, qi *DeviceQueueItem) error {
  	if err := qi.Validate(); err != nil {
  		return err
  	}
  
  	now := time.Now()
  	qi.CreatedAt = now
  	qi.UpdatedAt = now
  
  	err := sqlx.Get(db, &qi.ID, `
          insert into device_queue (
              created_at,
              updated_at,
  			dev_addr,
              dev_eui,
              frm_payload,
              f_cnt,
              f_port,
              confirmed,
              emit_at_time_since_gps_epoch,
              is_pending,
              timeout_after
          ) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
          returning id`,
  		qi.CreatedAt,
  		qi.UpdatedAt,
  		qi.DevAddr[:],
  		qi.DevEUI[:],
  		qi.FRMPayload,
  		qi.FCnt,
  		qi.FPort,
  		qi.Confirmed,
  		qi.EmitAtTimeSinceGPSEpoch,
  		qi.IsPending,
  		qi.TimeoutAfter,
  	)
  	if err != nil {
  		return handlePSQLError(err, "insert error")
  	}
  
  	log.WithFields(log.Fields{
  		"dev_eui": qi.DevEUI,
  		"f_cnt":   qi.FCnt,
  	}).Info("device-queue item created")
  
  	return nil
  }
docs: // CreateDeviceQueueItem adds the given item to the device queue.