MCPcopy Create free account
hub / github.com/dropbox/godropbox / SerializeSql

Method SerializeSql

database/sqlbuilder/expression.go:284–298  ·  view source on GitHub ↗
(out *bytes.Buffer)

Source from the content-addressed store, hash-verified

282}
283
284func (c *funcExpression) SerializeSql(out *bytes.Buffer) (err error) {
285 if !validIdentifierName(c.funcName) {
286 return errors.Newf(
287 "Invalid function name: %s. Generated sql: %s",
288 c.funcName,
289 out.String())
290 }
291 _, _ = out.WriteString(c.funcName)
292 if c.args == nil {
293 _, _ = out.WriteString("()")
294 } else {
295 return c.args.SerializeSql(out)
296 }
297 return nil
298}
299
300// Returns a representation of sql function call "func_call(c[0], ..., c[n-1])
301func SqlFunc(funcName string, expressions ...Expression) Expression {

Callers

nothing calls this directly

Calls 4

NewfFunction · 0.92
validIdentifierNameFunction · 0.85
StringMethod · 0.65
SerializeSqlMethod · 0.65

Tested by

no test coverage detected