Documentation ¶
Index ¶
- type OrderBy
- type OrderNulls
- type OrderResult
- type Orderer
- type Query
- type QueryFormatter
- type QueryInput
- type QueryRecord
- type QueryResult
- type Resource
- type WhereClause
- func WhereEquals(field string, value interface{}) (*WhereClause, error)
- func WhereGreaterThan(field string, value interface{}, equals bool) (*WhereClause, error)
- func WhereIn(field string, values []interface{}) (*WhereClause, error)
- func WhereLessThan(field string, value interface{}, equals bool) (*WhereClause, error)
- func WhereLike(field string, value string) (*WhereClause, error)
- func WhereNotEquals(field string, value interface{}) (*WhereClause, error)
- func WhereNotIn(field string, values []interface{}) (*WhereClause, error)
- type WhereClauser
- type WhereExpression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrderBy ¶
type OrderBy struct {
// contains filtered or unexported fields
}
OrderBy is the ordering structure of the SOQL query.
func NewOrderBy ¶
func NewOrderBy(result OrderResult) (*OrderBy, error)
NewOrderBy creates an OrderBy structure. If the order results is not ASC or DESC, an error will be returned.
func (*OrderBy) FieldOrder ¶
FieldOrder is a list of fields in the ordering.
func (*OrderBy) NullOrdering ¶
func (o *OrderBy) NullOrdering(nulls OrderNulls) error
NullOrdering sets the ordering, first or last, of the null values.
type OrderNulls ¶
type OrderNulls string
OrderNulls is where the null values are placed in the ordering.
const ( // OrderNullsLast places the null values at the end of the ordering. OrderNullsLast OrderNulls = "NULLS LAST" // OrderNullsFirst places the null values at the start of the ordering. OrderNullsFirst OrderNulls = "NULLS FIRST" )
type OrderResult ¶
type OrderResult string
OrderResult is the type of ordering of the query result.
const ( // OrderAsc will place the results in ascending order. OrderAsc OrderResult = "ASC" // OrderDesc will place the results in descending order. OrderDesc OrderResult = "DESC" )
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is the struture used to build a SOQL query.
func NewQuery ¶
func NewQuery(input QueryInput) (*Query, error)
NewQuery creates a new builder. If the object is an empty string, then an error is returned.
type QueryFormatter ¶
QueryFormatter is the interface to return the SOQL query.
Format returns the SOQL query.
type QueryInput ¶
type QueryInput struct { FieldList []string ObjectType string SubQuery []QueryFormatter Where WhereClauser Order Orderer Limit int Offset int }
QueryInput is used to provide SOQL inputs.
ObjectType is the Salesforce Object, like Account ¶
FieldList is the Salesforce Object's fields to query ¶
SubQuery is the inner query ¶
Where is the SOQL where cause ¶
Order is the SOQL ordering ¶
Limit is the SOQL record limit ¶
Offset is the SOQL record offset
type QueryRecord ¶
type QueryRecord struct {
// contains filtered or unexported fields
}
QueryRecord is the result of the SOQL record. If the query statement contains an inner query, there will be a group of subresults.
func (*QueryRecord) Record ¶
func (rec *QueryRecord) Record() *sfdc.Record
Record returns the SOQL record.
func (*QueryRecord) Subresult ¶
func (rec *QueryRecord) Subresult(sub string) (*QueryResult, bool)
Subresult returns a specific inner query result.
func (*QueryRecord) Subresults ¶
func (rec *QueryRecord) Subresults() map[string]*QueryResult
Subresults returns all of the inner query results.
type QueryResult ¶
type QueryResult struct {
// contains filtered or unexported fields
}
QueryResult is returned from the SOQL query. This will allow for retrieving all of the records and query the next round of records if available.
func (*QueryResult) Done ¶
func (result *QueryResult) Done() bool
Done will indicate if the result does not contain any more records.
func (*QueryResult) MoreRecords ¶
func (result *QueryResult) MoreRecords() bool
MoreRecords will indicate if the remaining records require another Saleforce service callout.
func (*QueryResult) Next ¶
func (result *QueryResult) Next() (*QueryResult, error)
Next will query the next set of records.
func (*QueryResult) Records ¶
func (result *QueryResult) Records() []*QueryRecord
Records returns the records from the query request.
func (*QueryResult) TotalSize ¶
func (result *QueryResult) TotalSize() int
TotalSize is the total size of the query result. This may or may not be the size of the records in the result.
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Resource is the structure for the Salesforce SOQL API resource.
func NewResource ¶
func NewResource(session session.ServiceFormatter) (*Resource, error)
NewResource forms the Salesforce SOQL resource. The session formatter is required to form the proper URLs and authorization header.
func (*Resource) Query ¶
func (r *Resource) Query(querier QueryFormatter, all bool) (*QueryResult, error)
Query will call out to the Salesforce org for a SOQL. The results will be the result of the query. The all parameter is for querying all records, which include deleted records that are in the recycle bin.
type WhereClause ¶
type WhereClause struct {
// contains filtered or unexported fields
}
WhereClause is the structure that will contain a SOQL where clause.
func WhereEquals ¶
func WhereEquals(field string, value interface{}) (*WhereClause, error)
WhereEquals forms the equals where expression.
func WhereGreaterThan ¶
func WhereGreaterThan(field string, value interface{}, equals bool) (*WhereClause, error)
WhereGreaterThan will form the greater or equal than expression. If the value is a string or boolean, an error is returned.
func WhereIn ¶
func WhereIn(field string, values []interface{}) (*WhereClause, error)
WhereIn forms the field in a set expression.
func WhereLessThan ¶
func WhereLessThan(field string, value interface{}, equals bool) (*WhereClause, error)
WhereLessThan will form the less or equal than expression. If the value is a string or boolean, an error is returned.
func WhereLike ¶
func WhereLike(field string, value string) (*WhereClause, error)
WhereLike will form the LIKE expression.
func WhereNotEquals ¶
func WhereNotEquals(field string, value interface{}) (*WhereClause, error)
WhereNotEquals forms the not equals where expression.
func WhereNotIn ¶
func WhereNotIn(field string, values []interface{}) (*WhereClause, error)
WhereNotIn forms the field is not in a set expression.
func (*WhereClause) And ¶
func (wc *WhereClause) And(where WhereExpression)
And will logical AND the expressions.
func (*WhereClause) Clause ¶
func (wc *WhereClause) Clause() string
Clause returns the where cluase.
func (*WhereClause) Expression ¶
func (wc *WhereClause) Expression() string
Expression will return the where expression.
func (*WhereClause) Group ¶
func (wc *WhereClause) Group()
Group will form a grouping around the expression.
func (*WhereClause) Or ¶
func (wc *WhereClause) Or(where WhereExpression)
Or will logical OR the expressions.
type WhereClauser ¶
type WhereClauser interface {
Clause() string
}
WhereClauser is an interface to return the where cause.
type WhereExpression ¶
type WhereExpression interface {
Expression() string
}
WhereExpression is an interface to return the where cause's expression.