080ba47a06
Change-Id: I6a419c62700c568254ff67ae5b73efed2fc98aa2
20 lines
498 B
Go
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
|
|
})
|
|
}
|