storj/private/dbutil/pgutil/data.go
Egon Elbre 080ba47a06 all: fix dots
Change-Id: I6a419c62700c568254ff67ae5b73efed2fc98aa2
2020-07-16 14:58:28 +00:00

20 lines
498 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package pgutil
import (
"context"
"strconv"
"storj.io/storj/private/dbutil/dbschema"
)
// QueryData loads all data from tables.
func QueryData(ctx context.Context, db dbschema.Queryer, schema *dbschema.Schema) (*dbschema.Data, error) {
return dbschema.QueryData(ctx, db, schema, func(columnName string) string {
quoted := strconv.Quote(columnName)
return `quote_nullable(` + quoted + `) as ` + quoted
})
}