@@ -8,44 +8,46 @@ import (
8
8
)
9
9
10
10
type ReverseTransformer struct {
11
- defaultTransformer destination.DefaultReverseTransformer
11
+ * destination.DefaultReverseTransformer
12
12
}
13
13
14
- func ( t * ReverseTransformer ) ReverseTransformValues ( table * schema. Table , values [] any ) (schema. CQTypes , error ) {
15
- return t . defaultTransformer . ReverseTransformValues (table , values )
16
- }
14
+ var _ interface {
15
+ ReverseTransformValues (table * schema. Table , values [] any ) (schema. CQTypes , error )
16
+ } = ReverseTransformer {}
17
17
18
18
type Transformer struct {}
19
19
20
- func (* Transformer ) TransformBool (v * schema.Bool ) any {
20
+ var _ schema.CQTypeTransformer = Transformer {}
21
+
22
+ func (Transformer ) TransformBool (v * schema.Bool ) any {
21
23
if v .Status != schema .Present {
22
24
return nil
23
25
}
24
26
return v .Bool
25
27
}
26
28
27
- func (* Transformer ) TransformBytea (v * schema.Bytea ) any {
29
+ func (Transformer ) TransformBytea (v * schema.Bytea ) any {
28
30
if v .Status != schema .Present {
29
31
return nil
30
32
}
31
33
return v .String ()
32
34
}
33
35
34
- func (* Transformer ) TransformFloat8 (v * schema.Float8 ) any {
36
+ func (Transformer ) TransformFloat8 (v * schema.Float8 ) any {
35
37
if v .Status != schema .Present {
36
38
return nil
37
39
}
38
40
return v .Float
39
41
}
40
42
41
- func (* Transformer ) TransformInt8 (v * schema.Int8 ) any {
43
+ func (Transformer ) TransformInt8 (v * schema.Int8 ) any {
42
44
if v .Status != schema .Present {
43
45
return nil
44
46
}
45
47
return v .Int
46
48
}
47
49
48
- func (* Transformer ) TransformInt8Array (v * schema.Int8Array ) any {
50
+ func (Transformer ) TransformInt8Array (v * schema.Int8Array ) any {
49
51
if v .Status != schema .Present {
50
52
return nil
51
53
}
@@ -56,7 +58,7 @@ func (*Transformer) TransformInt8Array(v *schema.Int8Array) any {
56
58
return res
57
59
}
58
60
59
- func (* Transformer ) TransformJSON (v * schema.JSON ) any {
61
+ func (Transformer ) TransformJSON (v * schema.JSON ) any {
60
62
if v .Status != schema .Present {
61
63
return nil
62
64
}
@@ -67,14 +69,14 @@ func (*Transformer) TransformJSON(v *schema.JSON) any {
67
69
return res
68
70
}
69
71
70
- func (* Transformer ) TransformText (v * schema.Text ) any {
72
+ func (Transformer ) TransformText (v * schema.Text ) any {
71
73
if v .Status != schema .Present {
72
74
return nil
73
75
}
74
76
return v .Str
75
77
}
76
78
77
- func (* Transformer ) TransformTextArray (v * schema.TextArray ) any {
79
+ func (Transformer ) TransformTextArray (v * schema.TextArray ) any {
78
80
if v .Status != schema .Present {
79
81
return nil
80
82
}
@@ -85,21 +87,21 @@ func (*Transformer) TransformTextArray(v *schema.TextArray) any {
85
87
return res
86
88
}
87
89
88
- func (* Transformer ) TransformTimestamptz (v * schema.Timestamptz ) any {
90
+ func (Transformer ) TransformTimestamptz (v * schema.Timestamptz ) any {
89
91
if v .Status != schema .Present {
90
92
return nil
91
93
}
92
94
return v .String ()
93
95
}
94
96
95
- func (* Transformer ) TransformUUID (v * schema.UUID ) any {
97
+ func (Transformer ) TransformUUID (v * schema.UUID ) any {
96
98
if v .Status != schema .Present {
97
99
return nil
98
100
}
99
101
return v .String ()
100
102
}
101
103
102
- func (* Transformer ) TransformUUIDArray (v * schema.UUIDArray ) any {
104
+ func (Transformer ) TransformUUIDArray (v * schema.UUIDArray ) any {
103
105
if v .Status != schema .Present {
104
106
return nil
105
107
}
@@ -110,14 +112,14 @@ func (*Transformer) TransformUUIDArray(v *schema.UUIDArray) any {
110
112
return res
111
113
}
112
114
113
- func (* Transformer ) TransformCIDR (v * schema.CIDR ) any {
115
+ func (Transformer ) TransformCIDR (v * schema.CIDR ) any {
114
116
if v .Status != schema .Present {
115
117
return nil
116
118
}
117
119
return v .String ()
118
120
}
119
121
120
- func (* Transformer ) TransformCIDRArray (v * schema.CIDRArray ) any {
122
+ func (Transformer ) TransformCIDRArray (v * schema.CIDRArray ) any {
121
123
if v .Status != schema .Present {
122
124
return nil
123
125
}
@@ -128,14 +130,14 @@ func (*Transformer) TransformCIDRArray(v *schema.CIDRArray) any {
128
130
return res
129
131
}
130
132
131
- func (* Transformer ) TransformInet (v * schema.Inet ) any {
133
+ func (Transformer ) TransformInet (v * schema.Inet ) any {
132
134
if v .Status != schema .Present {
133
135
return nil
134
136
}
135
137
return v .String ()
136
138
}
137
139
138
- func (* Transformer ) TransformInetArray (v * schema.InetArray ) any {
140
+ func (Transformer ) TransformInetArray (v * schema.InetArray ) any {
139
141
if v .Status != schema .Present {
140
142
return nil
141
143
}
@@ -146,14 +148,14 @@ func (*Transformer) TransformInetArray(v *schema.InetArray) any {
146
148
return v .String ()
147
149
}
148
150
149
- func (* Transformer ) TransformMacaddr (v * schema.Macaddr ) any {
151
+ func (Transformer ) TransformMacaddr (v * schema.Macaddr ) any {
150
152
if v .Status != schema .Present {
151
153
return nil
152
154
}
153
155
return v .String ()
154
156
}
155
157
156
- func (* Transformer ) TransformMacaddrArray (v * schema.MacaddrArray ) any {
158
+ func (Transformer ) TransformMacaddrArray (v * schema.MacaddrArray ) any {
157
159
if v .Status != schema .Present {
158
160
return nil
159
161
}
0 commit comments