MCPcopy Create free account
hub / github.com/AfterShip/clickhouse-sql-parser / FormatSQL

Method FormatSQL

parser/format.go:1741–1774  ·  view source on GitHub ↗
(formatter *Formatter)

Source from the content-addressed store, hash-verified

1739}
1740
1741func (j *JSONOption) FormatSQL(formatter *Formatter) {
1742 wroteAny := false
1743 if j.SkipPath != nil {
1744 formatter.WriteString("SKIP ")
1745 j.SkipPath.FormatSQL(formatter)
1746 wroteAny = true
1747 }
1748 if j.SkipRegex != nil {
1749 formatter.WriteString(" SKIP REGEXP ")
1750 formatter.WriteExpr(j.SkipRegex)
1751 wroteAny = true
1752 }
1753 if j.MaxDynamicPaths != nil {
1754 formatter.WriteString("max_dynamic_paths")
1755 formatter.WriteByte('=')
1756 formatter.WriteExpr(j.MaxDynamicPaths)
1757 wroteAny = true
1758 }
1759 if j.MaxDynamicTypes != nil {
1760 formatter.WriteString("max_dynamic_types")
1761 formatter.WriteByte('=')
1762 formatter.WriteExpr(j.MaxDynamicTypes)
1763 wroteAny = true
1764 }
1765 if j.Column != nil && j.Column.Path != nil && j.Column.Type != nil {
1766 // Add a leading space if there is already content.
1767 if wroteAny {
1768 formatter.WriteByte(whitespace)
1769 }
1770 j.Column.Path.FormatSQL(formatter)
1771 formatter.WriteByte(whitespace)
1772 formatter.WriteExpr(j.Column.Type)
1773 }
1774}
1775
1776func (j *JSONOptions) FormatSQL(formatter *Formatter) {
1777 formatter.WriteByte('(')

Callers

nothing calls this directly

Calls 4

WriteStringMethod · 0.80
WriteExprMethod · 0.80
WriteByteMethod · 0.80
FormatSQLMethod · 0.65

Tested by

no test coverage detected