code: func AuthPermissionByID(db XODB, id int) (*AuthPermission, error) {
  	var err error
  
  	// sql query
  	const sqlstr = `SELECT ` +
  		`id, name, content_type_id, codename ` +
  		`FROM public.auth_permission ` +
  		`WHERE id = $1`
  
  	// run query
  	XOLog(sqlstr, id)
  	ap := AuthPermission{
  		_exists: true,
  	}
  
  	err = db.QueryRow(sqlstr, id).Scan(&ap.ID, &ap.Name, &ap.ContentTypeID, &ap.Codename)
  	if err != nil {
  		return nil, err
  	}
  
  	return &ap, nil
  }
docs: // AuthPermissionByID retrieves a row from 'public.auth_permission' as a AuthPermission.
  //
  // Generated from index 'auth_permission_pkey'.