code: func (t *IPsTable) add(c context.Context) error {
  	// Avoid using the database connection to prepare unnecessary statements.
  	if len(t.additions) == 0 {
  		return nil
  	}
  
  	db := database.Get(c)
  	stmt, err := db.PrepareContext(c, `
  		INSERT INTO ips (ipv4, vlan_id)
  		VALUES (?, ?)
  	`)
  	if err != nil {
  		return errors.Annotate(err, "failed to prepare statement").Err()
  	}
  	defer stmt.Close()
  
  	// Add each IP address to the database, and update the slice of IP address with each addition.
  	// TODO(smut): Batch SQL operations if it becomes necessary.
  	logging.Infof(c, "Attempting to add %d IP addresses", len(t.additions))
  	for len(t.additions) > 0 {
  		ip := t.additions[0]
  		result, err := stmt.ExecContext(c, ip.IPv4, ip.VLANId)
  		if err != nil {
  			return errors.Annotate(err, "failed to add IP address %q", ip.IPv4).Err()
  		}
  		t.current = append(t.current, ip)
  		t.additions = t.additions[1:]
  		logging.Infof(c, "Added IP address %q", ip.IPv4)
  		ip.Id, err = result.LastInsertId()
  		if err != nil {
  			return errors.Annotate(err, "failed to get IP address ID %q", ip.IPv4).Err()
  		}
  	}
  	return nil
  }
docs: // add adds all IP addresses pending addition to the database, clearing pending additions.
  // No-op unless computeChanges was called first. Idempotent until computeChanges is called again.