lxd/db/projects.mapper.go
func (c *ClusterTx) ProjectURIs(filter ProjectFilter) ([]string, error) {
	// Check which filter criteria are active.
	criteria := map[string]interface{}{}
	if filter.Name != "" {
		criteria["Name"] = filter.Name
	}

	// Pick the prepared statement and arguments to use based on active criteria.
	var stmt *sql.Stmt
	var args []interface{}

	if criteria["Name"] != nil {
		stmt = c.stmt(projectNamesByName)
		args = []interface{}{
			filter.Name,
		}
	} else {
		stmt = c.stmt(projectNames)
		args = []interface{}{}
	}

	code := cluster.EntityTypes["project"]
	formatter := cluster.EntityFormatURIs[code]

	return query.SelectURIs(stmt, formatter, args...)
}
func (c *ClusterTx) ProjectURIs(filter ProjectFilter) ([]string, error) {
	// Check which filter criteria are active.
	criteria := map[string]interface{}{}
	if filter.Name != "" {
		criteria["Name"] = filter.Name
	}

	// Pick the prepared statement and arguments to use based on active criteria.
	var stmt *sql.Stmt
	var args []interface{}

	if criteria["Name"] != nil {
		stmt = c.stmt(projectNamesByName)
		args = []interface{}{
			filter.Name,
		}
	} else {
		stmt = c.stmt(projectNames)
		args = []interface{}{}
	}

	code := cluster.EntityTypes["project"]
	formatter := cluster.EntityFormatURIs[code]

	return query.SelectURIs(stmt, formatter, args...)
}
// ProjectURIs returns all available project URIs.