Skip to content

Commit daaf9ab

Browse files
committed
yson query builder
1 parent 0919e4c commit daaf9ab

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

internal/params/builder_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ func TestBuilder(t *testing.T) {
374374
{
375375
name: xtest.CurrentFileLine(),
376376
builder: Builder{}.
377-
Param("$x").Json(`{"a": 1,"b": "B"}`).Build(),
377+
Param("$x").JSON(`{"a": 1,"b": "B"}`).Build(),
378378
params: map[string]*Ydb.TypedValue{
379379
"$x": {
380380
Type: &Ydb.Type{
@@ -393,7 +393,7 @@ func TestBuilder(t *testing.T) {
393393
{
394394
name: xtest.CurrentFileLine(),
395395
builder: Builder{}.
396-
Param("$x").JsonDocument(`{"a": 1,"b": "B"}`).Build(),
396+
Param("$x").JSONDocument(`{"a": 1,"b": "B"}`).Build(),
397397
params: map[string]*Ydb.TypedValue{
398398
"$x": {
399399
Type: &Ydb.Type{
@@ -412,7 +412,7 @@ func TestBuilder(t *testing.T) {
412412
{
413413
name: xtest.CurrentFileLine(),
414414
builder: Builder{}.
415-
Param("$x").Yson([]byte(`[ 1; 2; 3; 4; 5 ]`)).Build(),
415+
Param("$x").YSON([]byte(`[ 1; 2; 3; 4; 5 ]`)).Build(),
416416
params: map[string]*Ydb.TypedValue{
417417
"$x": {
418418
Type: &Ydb.Type{
@@ -432,7 +432,7 @@ func TestBuilder(t *testing.T) {
432432
name: xtest.CurrentFileLine(),
433433
builder: Builder{}.
434434
Param("$x").
435-
Uuid([...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}).
435+
UUID([...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}).
436436
Build(),
437437
params: map[string]*Ydb.TypedValue{
438438
"$x": {

internal/params/optional.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,25 +135,25 @@ func (p *optional) Interval(v time.Duration) *optionalBuilder {
135135
return &optionalBuilder{opt: p}
136136
}
137137

138-
func (p *optional) Json(v string) *optionalBuilder {
138+
func (p *optional) JSON(v string) *optionalBuilder {
139139
p.value = value.JSONValue(v)
140140

141141
return &optionalBuilder{opt: p}
142142
}
143143

144-
func (p *optional) JsonDocument(v string) *optionalBuilder {
144+
func (p *optional) JSONDocument(v string) *optionalBuilder {
145145
p.value = value.JSONDocumentValue(v)
146146

147147
return &optionalBuilder{opt: p}
148148
}
149149

150-
func (p *optional) Yson(v []byte) *optionalBuilder {
150+
func (p *optional) YSON(v []byte) *optionalBuilder {
151151
p.value = value.YSONValue(v)
152152

153153
return &optionalBuilder{opt: p}
154154
}
155155

156-
func (p *optional) Uuid(v [16]byte) *optionalBuilder {
156+
func (p *optional) UUID(v [16]byte) *optionalBuilder {
157157
p.value = value.UUIDValue(v)
158158

159159
return &optionalBuilder{opt: p}

internal/params/optional_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ func TestOptional(t *testing.T) {
455455
},
456456
{
457457
name: xtest.CurrentFileLine(),
458-
builder: Builder{}.Param("$x").Optional().Json(`{"a": 1,"b": "B"}`).Build(),
458+
builder: Builder{}.Param("$x").Optional().JSON(`{"a": 1,"b": "B"}`).Build(),
459459
params: map[string]*Ydb.TypedValue{
460460
"$x": {
461461
Type: &Ydb.Type{
@@ -479,7 +479,7 @@ func TestOptional(t *testing.T) {
479479
},
480480
{
481481
name: xtest.CurrentFileLine(),
482-
builder: Builder{}.Param("$x").Optional().JsonDocument(`{"a": 1,"b": "B"}`).Build(),
482+
builder: Builder{}.Param("$x").Optional().JSONDocument(`{"a": 1,"b": "B"}`).Build(),
483483
params: map[string]*Ydb.TypedValue{
484484
"$x": {
485485
Type: &Ydb.Type{
@@ -503,7 +503,7 @@ func TestOptional(t *testing.T) {
503503
},
504504
{
505505
name: xtest.CurrentFileLine(),
506-
builder: Builder{}.Param("$x").Optional().Yson([]byte(`[ 1; 2; 3; 4; 5 ]`)).Build(),
506+
builder: Builder{}.Param("$x").Optional().YSON([]byte(`[ 1; 2; 3; 4; 5 ]`)).Build(),
507507
params: map[string]*Ydb.TypedValue{
508508
"$x": {
509509
Type: &Ydb.Type{
@@ -529,7 +529,7 @@ func TestOptional(t *testing.T) {
529529
name: xtest.CurrentFileLine(),
530530
builder: Builder{}.Param("$x").
531531
Optional().
532-
Uuid([...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}).
532+
UUID([...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}).
533533
Build(),
534534
params: map[string]*Ydb.TypedValue{
535535
"$x": {

internal/params/parameters.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,28 +242,28 @@ func (p *Parameter) Interval(v time.Duration) Builder {
242242
return p.parent
243243
}
244244

245-
func (p *Parameter) Json(v string) Builder {
245+
func (p *Parameter) JSON(v string) Builder {
246246
p.value = value.JSONValue(v)
247247
p.parent.params = append(p.parent.params, p)
248248

249249
return p.parent
250250
}
251251

252-
func (p *Parameter) JsonDocument(v string) Builder {
252+
func (p *Parameter) JSONDocument(v string) Builder {
253253
p.value = value.JSONDocumentValue(v)
254254
p.parent.params = append(p.parent.params, p)
255255

256256
return p.parent
257257
}
258258

259-
func (p *Parameter) Yson(v []byte) Builder {
259+
func (p *Parameter) YSON(v []byte) Builder {
260260
p.value = value.YSONValue(v)
261261
p.parent.params = append(p.parent.params, p)
262262

263263
return p.parent
264264
}
265265

266-
func (p *Parameter) Uuid(v [16]byte) Builder {
266+
func (p *Parameter) UUID(v [16]byte) Builder {
267267
p.value = value.UUIDValue(v)
268268
p.parent.params = append(p.parent.params, p)
269269

0 commit comments

Comments
 (0)