Skip to content

Commit

Permalink
statement: add suport for user provided identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
brunotm committed Mar 17, 2022
1 parent 522c652 commit 1f868f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions statement/part.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
"github.com/brunotm/norm/internal/buffer"
)

// Ident type is handled as an user provided identifier as is in the resulting query
type Ident string

// Part is a query fragment that satisfies the statement.Statement interface
type Part struct {
Query string
Expand Down Expand Up @@ -55,6 +58,8 @@ func (p *Part) build(buf Buffer, keyword bool) (err error) {
_, _ = buf.WriteString("(")
err = arg.Build(buf)
_, _ = buf.WriteString(")")
case Ident:
_, _ = buf.WriteString(string(arg))
default:
err = writeValue(buf, arg, keyword)
}
Expand Down

0 comments on commit 1f868f6

Please sign in to comment.