Encode json values implicitly in the sql queries according the golang json package spec.

This commit is contained in:
go-jet 2025-03-08 19:01:37 +01:00
parent 9616bb5cfe
commit 17646ca99c
54 changed files with 1446 additions and 744 deletions

View file

@ -61,6 +61,16 @@ func (s *SQLBuilder) WriteProjections(statement StatementType, projections []Pro
s.DecreaseIdent()
}
func (s *SQLBuilder) WriteRowToJsonProjections(statement StatementType, projections []Projection) {
for i, projection := range projections {
if i > 0 {
s.WriteString(",")
s.NewLine()
}
projection.serializeForRowToJsonProjection(statement, s)
}
}
// NewLine adds new line to output SQL
func (s *SQLBuilder) NewLine() {
s.write([]byte{'\n'})