code: func Query(db *sql.DB, terms []string) ([]*CertificateMetadata, error) {
  	tx, err := db.Begin()
  	if err != nil {
  		return nil, err
  	}
  	defer tx.Rollback()
  
  	certs, err := certdb.AllCertificates(tx)
  	if err != nil {
  		return nil, err
  	}
  
  	results := make([]*CertificateMetadata, len(certs))
  	for i := range certs {
  		results[i], err = LoadCertificateMetadata(tx, certs[i])
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	filters := make([]CertificateFilter, 0, len(terms))
  	for _, term := range terms {
  		f, err := ParseQuery(term)
  		if err != nil {
  			return nil, err
  		}
  
  		filters = append(filters, f)
  	}
  
  	err = tx.Commit()
  	return filterCertificates(results, filters), err
  }
docs: // Query searches the database for all certificates matching the search terms.