Skip to content

Commit

Permalink
Quote schema when running ReadSchema (#419)
Browse files Browse the repository at this point in the history
I noticed we were are quoting the schema everywhere else, but not here.
  • Loading branch information
ryanslade authored Oct 21, 2024
1 parent 01ff6ac commit 7c01085
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ func (s *State) Complete(ctx context.Context, schema, name string) error {
// ReadSchema reads the schema for the specified schema name
func (s *State) ReadSchema(ctx context.Context, schemaName string) (*schema.Schema, error) {
var rawSchema []byte
err := s.pgConn.QueryRowContext(ctx, fmt.Sprintf("SELECT %s.read_schema($1)", s.schema), schemaName).Scan(&rawSchema)
err := s.pgConn.QueryRowContext(ctx, fmt.Sprintf("SELECT %s.read_schema($1)", pq.QuoteIdentifier(s.schema)), schemaName).Scan(&rawSchema)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7c01085

Please sign in to comment.