0835b9024c
Change-Id: Icfd56ca8c1f831ad56c0195a0b883e8f0618daaf
20 lines
492 B
Go
20 lines
492 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(db, schema, func(columnName string) string {
|
|
quoted := strconv.Quote(columnName)
|
|
return `quote_nullable(` + quoted + `) as ` + quoted
|
|
})
|
|
}
|