Exemplo n.º 1
0
// Exists checks if the row exists in the table.
func (q contactRelationshipQuery) Exists() (bool, error) {
	var count int64

	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)

	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "chado: failed to check if contact_relationship exists")
	}

	return count > 0, nil
}
Exemplo n.º 2
0
// Exists checks if the row exists in the table.
func (q featurepropPubQuery) Exists() (bool, error) {
	var count int64

	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)

	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "chado: failed to check if featureprop_pub exists")
	}

	return count > 0, nil
}
// Exists checks if the row exists in the table.
func (q phenotypeComparisonCvtermQuery) Exists() (bool, error) {
	var count int64

	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)

	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "chado: failed to check if phenotype_comparison_cvterm exists")
	}

	return count > 0, nil
}
Exemplo n.º 4
0
// Exists checks if the row exists in the table.
func (q authUserRoleQuery) Exists() (bool, error) {
	var count int64

	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)

	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "chado: failed to check if auth_user_role exists")
	}

	return count > 0, nil
}
Exemplo n.º 5
0
// Exists checks if the row exists in the table.
func (q cvtermDbxrefQuery) Exists() (bool, error) {
	var count int64

	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)

	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "chado: failed to check if cvterm_dbxref exists")
	}

	return count > 0, nil
}
Exemplo n.º 6
0
// Exists checks if the row exists in the table.
func (q stockcollectionQuery) Exists() (bool, error) {
	var count int64

	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)

	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "chado: failed to check if stockcollection exists")
	}

	return count > 0, nil
}
Exemplo n.º 7
0
Arquivo: files.go Projeto: zqzca/back
// Exists checks if the row exists in the table.
func (q fileQuery) Exists() (bool, error) {
	var count int64

	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)

	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "models: failed to check if files exists")
	}

	return count > 0, nil
}
Exemplo n.º 8
0
// Exists checks if the row exists in the table.
func (q jbrowseOrganismQuery) Exists() (bool, error) {
	var count int64

	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)

	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "chado: failed to check if jbrowse_organism exists")
	}

	return count > 0, nil
}
// One returns a single stockRelationshipCvterm record from the query.
func (q stockRelationshipCvtermQuery) One() (*StockRelationshipCvterm, error) {
	o := &StockRelationshipCvterm{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for stock_relationship_cvterm")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 10
0
// One returns a single featurepropPub record from the query.
func (q featurepropPubQuery) One() (*FeaturepropPub, error) {
	o := &FeaturepropPub{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for featureprop_pub")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 11
0
// One returns a single tableinfo record from the query.
func (q tableinfoQuery) One() (*Tableinfo, error) {
	o := &Tableinfo{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for tableinfo")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 12
0
// One returns a single authUserRole record from the query.
func (q authUserRoleQuery) One() (*AuthUserRole, error) {
	o := &AuthUserRole{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for auth_user_role")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 13
0
// One returns a single cvtermDbxref record from the query.
func (q cvtermDbxrefQuery) One() (*CvtermDbxref, error) {
	o := &CvtermDbxref{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for cvterm_dbxref")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 14
0
// One returns a single stockItemOrder record from the query.
func (q stockItemOrderQuery) One() (*StockItemOrder, error) {
	o := &StockItemOrder{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for stock_item_order")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 15
0
Arquivo: files.go Projeto: zqzca/back
// One returns a single file record from the query.
func (q fileQuery) One() (*File, error) {
	o := &File{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "models: failed to execute a one query for files")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 16
0
// One returns a single pubRelationship record from the query.
func (q pubRelationshipQuery) One() (*PubRelationship, error) {
	o := &PubRelationship{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for pub_relationship")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 17
0
// One returns a single phenstatement record from the query.
func (q phenstatementQuery) One() (*Phenstatement, error) {
	o := &Phenstatement{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for phenstatement")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}
Exemplo n.º 18
0
// One returns a single jbrowseOrganism record from the query.
func (q jbrowseOrganismQuery) One() (*JbrowseOrganism, error) {
	o := &JbrowseOrganism{}

	queries.SetLimit(q.Query, 1)

	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "chado: failed to execute a one query for jbrowse_organism")
	}

	if err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {
		return o, err
	}

	return o, nil
}