Skip to content

Commit dbd5583

Browse files
kyleconroyclaude
andcommitted
chore: return empty function set from stdlib
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c90b86c commit dbd5583

File tree

1 file changed

+1
-160
lines changed

1 file changed

+1
-160
lines changed
Lines changed: 1 addition & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,9 @@
11
package clickhouse
22

33
import (
4-
"github.com/sqlc-dev/sqlc/internal/sql/ast"
54
"github.com/sqlc-dev/sqlc/internal/sql/catalog"
65
)
76

87
func defaultSchema(name string) *catalog.Schema {
9-
s := &catalog.Schema{Name: name}
10-
s.Funcs = []*catalog.Function{
11-
// Aggregate functions
12-
{
13-
Name: "count",
14-
Args: []*catalog.Argument{},
15-
ReturnType: &ast.TypeName{Name: "UInt64"},
16-
},
17-
{
18-
Name: "sum",
19-
Args: []*catalog.Argument{
20-
{Type: &ast.TypeName{Name: "any"}},
21-
},
22-
ReturnType: &ast.TypeName{Name: "any"},
23-
},
24-
{
25-
Name: "avg",
26-
Args: []*catalog.Argument{
27-
{Type: &ast.TypeName{Name: "any"}},
28-
},
29-
ReturnType: &ast.TypeName{Name: "Float64"},
30-
},
31-
{
32-
Name: "min",
33-
Args: []*catalog.Argument{
34-
{Type: &ast.TypeName{Name: "any"}},
35-
},
36-
ReturnType: &ast.TypeName{Name: "any"},
37-
},
38-
{
39-
Name: "max",
40-
Args: []*catalog.Argument{
41-
{Type: &ast.TypeName{Name: "any"}},
42-
},
43-
ReturnType: &ast.TypeName{Name: "any"},
44-
},
45-
// Type conversion functions
46-
{
47-
Name: "toInt32",
48-
Args: []*catalog.Argument{
49-
{Type: &ast.TypeName{Name: "any"}},
50-
},
51-
ReturnType: &ast.TypeName{Name: "Int32"},
52-
},
53-
{
54-
Name: "toInt64",
55-
Args: []*catalog.Argument{
56-
{Type: &ast.TypeName{Name: "any"}},
57-
},
58-
ReturnType: &ast.TypeName{Name: "Int64"},
59-
},
60-
{
61-
Name: "toUInt32",
62-
Args: []*catalog.Argument{
63-
{Type: &ast.TypeName{Name: "any"}},
64-
},
65-
ReturnType: &ast.TypeName{Name: "UInt32"},
66-
},
67-
{
68-
Name: "toUInt64",
69-
Args: []*catalog.Argument{
70-
{Type: &ast.TypeName{Name: "any"}},
71-
},
72-
ReturnType: &ast.TypeName{Name: "UInt64"},
73-
},
74-
{
75-
Name: "toString",
76-
Args: []*catalog.Argument{
77-
{Type: &ast.TypeName{Name: "any"}},
78-
},
79-
ReturnType: &ast.TypeName{Name: "String"},
80-
},
81-
{
82-
Name: "toFloat64",
83-
Args: []*catalog.Argument{
84-
{Type: &ast.TypeName{Name: "any"}},
85-
},
86-
ReturnType: &ast.TypeName{Name: "Float64"},
87-
},
88-
// Date/time functions
89-
{
90-
Name: "now",
91-
Args: []*catalog.Argument{},
92-
ReturnType: &ast.TypeName{Name: "DateTime"},
93-
},
94-
{
95-
Name: "today",
96-
Args: []*catalog.Argument{},
97-
ReturnType: &ast.TypeName{Name: "Date"},
98-
},
99-
{
100-
Name: "toDate",
101-
Args: []*catalog.Argument{
102-
{Type: &ast.TypeName{Name: "any"}},
103-
},
104-
ReturnType: &ast.TypeName{Name: "Date"},
105-
},
106-
{
107-
Name: "toDateTime",
108-
Args: []*catalog.Argument{
109-
{Type: &ast.TypeName{Name: "any"}},
110-
},
111-
ReturnType: &ast.TypeName{Name: "DateTime"},
112-
},
113-
// String functions
114-
{
115-
Name: "concat",
116-
Args: []*catalog.Argument{
117-
{Type: &ast.TypeName{Name: "String"}},
118-
{Type: &ast.TypeName{Name: "String"}},
119-
},
120-
ReturnType: &ast.TypeName{Name: "String"},
121-
},
122-
{
123-
Name: "lower",
124-
Args: []*catalog.Argument{
125-
{Type: &ast.TypeName{Name: "String"}},
126-
},
127-
ReturnType: &ast.TypeName{Name: "String"},
128-
},
129-
{
130-
Name: "upper",
131-
Args: []*catalog.Argument{
132-
{Type: &ast.TypeName{Name: "String"}},
133-
},
134-
ReturnType: &ast.TypeName{Name: "String"},
135-
},
136-
{
137-
Name: "length",
138-
Args: []*catalog.Argument{
139-
{Type: &ast.TypeName{Name: "String"}},
140-
},
141-
ReturnType: &ast.TypeName{Name: "UInt64"},
142-
},
143-
// Conditional functions
144-
{
145-
Name: "if",
146-
Args: []*catalog.Argument{
147-
{Type: &ast.TypeName{Name: "UInt8"}},
148-
{Type: &ast.TypeName{Name: "any"}},
149-
{Type: &ast.TypeName{Name: "any"}},
150-
},
151-
ReturnType: &ast.TypeName{Name: "any"},
152-
},
153-
// Array functions
154-
{
155-
Name: "array",
156-
Args: []*catalog.Argument{},
157-
ReturnType: &ast.TypeName{Name: "Array"},
158-
},
159-
{
160-
Name: "arrayJoin",
161-
Args: []*catalog.Argument{
162-
{Type: &ast.TypeName{Name: "Array"}},
163-
},
164-
ReturnType: &ast.TypeName{Name: "any"},
165-
},
166-
}
167-
return s
8+
return &catalog.Schema{Name: name}
1689
}

0 commit comments

Comments
 (0)