Builds the query statement for a roleAccess N1QL query.
(username string)
| 479 | |
| 480 | // Builds the query statement for a roleAccess N1QL query. |
| 481 | func (c *DatabaseCollection) buildRoleAccessQuery(username string) string { |
| 482 | statement := replaceSyncTokensQuery(QueryRoleAccess.statement, c.UseXattrs()) |
| 483 | |
| 484 | // SG usernames don't allow back tick, but guard username in select clause for additional safety |
| 485 | username = strings.Replace(username, "`", "``", -1) |
| 486 | statement = strings.Replace(statement, QuerySelectUserName, username, -1) |
| 487 | statement = replaceIndexTokensQuery(statement, sgIndexes[IndexRoleAccess], c.UseXattrs(), c.numIndexPartitions()) |
| 488 | return statement |
| 489 | } |
| 490 | |
| 491 | // Query to compute the set of documents assigned to the specified channel within the sequence range |
| 492 | func (c *DatabaseCollection) QueryChannels(ctx context.Context, channelName string, startSeq uint64, endSeq uint64, limit int, activeOnly bool) (sgbucket.QueryResultIterator, error) { |