code: func (ap *AuthPermission) Insert(db XODB) error {
  	var err error
  
  	// if already exist, bail
  	if ap._exists {
  		return errors.New("insert failed: already exists")
  	}
  
  	// sql insert query, primary key provided by sequence
  	const sqlstr = `INSERT INTO public.auth_permission (` +
  		`name, content_type_id, codename` +
  		`) VALUES (` +
  		`$1, $2, $3` +
  		`) RETURNING id`
  
  	// run query
  	XOLog(sqlstr, ap.Name, ap.ContentTypeID, ap.Codename)
  	err = db.QueryRow(sqlstr, ap.Name, ap.ContentTypeID, ap.Codename).Scan(&ap.ID)
  	if err != nil {
  		return err
  	}
  
  	// set existence
  	ap._exists = true
  
  	return nil
  }
docs: // Insert inserts the AuthPermission to the database.