Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e949b19
Initial YDB support: SELECT logic, some convert tests, and YDB engine…
1NepuNep1 Apr 22, 2025
4e46daa
Added almost full INSERT support and basic DELETE (without ON) support
1NepuNep1 Apr 26, 2025
3a4f818
Added UPDATE and DELETE full logic. Updated examples in example/authors
1NepuNep1 Apr 28, 2025
e980d19
Added some examples and README for demo
1NepuNep1 Apr 28, 2025
3013c84
Supported some more YQL constructions:
1NepuNep1 May 17, 2025
e687cf6
ADDED DROP/ALTER USER/GROUP
1NepuNep1 May 19, 2025
0293f6a
Added Funcs support!
1NepuNep1 May 20, 2025
fc8c932
Added examples for funcs codegen
1NepuNep1 May 21, 2025
d0e1550
Upgraded jwt to 4.5.2
1NepuNep1 May 27, 2025
0b1752a
First ydb-go-sdk generation version (See #4) (#6)
1NepuNep1 Sep 2, 2025
4eb8ff5
Bump sqlc version in examples/authors/ydb to v1.30.0
Sep 3, 2025
14b60c5
Rewrited comments and testdata to eng
Sep 3, 2025
f2d7aea
Expanding YQL Syntax support in sqlc engine (Refactored SELECT (Suppo…
1NepuNep1 Sep 8, 2025
296cca7
Made new params building logic & got rid off .Query handle (#11)
1NepuNep1 Sep 9, 2025
1379e43
Rewrited convert to Visitor Interface from ANTLR4 + fixed some types …
1NepuNep1 Sep 23, 2025
a680b1b
Massive Optional + Functions update (#13)
1NepuNep1 Sep 26, 2025
a69429c
Added simple types in param builder and ydbType (#14)
1NepuNep1 Oct 8, 2025
816eda8
Ydb-go-sdk codegen: Containers support in ydb.ParamsBuilder() (#15)
1NepuNep1 Oct 9, 2025
2eaa5d0
Tests: Added a lot of ydb e2e tests + some engine and types fixes
1NepuNep1 Oct 27, 2025
bde9d5e
Merge branch 'main' into ydb
1NepuNep1 Oct 27, 2025
08424e0
Resolved go.mod && go.sum
1NepuNep1 Oct 27, 2025
be13a37
Fixed builtins test
1NepuNep1 Oct 27, 2025
683926c
Added docs and rewrited examples for ydb (#17)
1NepuNep1 Oct 27, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rewrited comments and testdata to eng
  • Loading branch information
Viktor Pentyukhov committed Sep 3, 2025
commit 14b60c501a7ace05dd0089df8d6e2661a0fabe2e
47 changes: 0 additions & 47 deletions examples/authors/ydb/README.md

This file was deleted.

28 changes: 14 additions & 14 deletions examples/authors/ydb/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ func TestAuthors(t *testing.T) {

t.Run("InsertAuthors", func(t *testing.T) {
authorsToInsert := []CreateOrUpdateAuthorParams{
{P0: 1, P1: "Лев Толстой", P2: ptr("Русский писатель, автор \"Война �� мир\"")},
{P0: 2, P1: "Александр Пушкин", P2: ptr("Автор \"Евгения Онегина\"")},
{P0: 3, P1: "Александр Пушкин", P2: ptr("Русский поэт, драматург и прозаик")},
{P0: 4, P1: "Фёдор Достоевский", P2: ptr("Автор \"Преступление и наказание\"")},
{P0: 5, P1: "Николай Гоголь", P2: ptr("Автор \"Мёртвые души\"")},
{P0: 6, P1: "Антон Чехов", P2: nil},
{P0: 7, P1: "Иван Тургенев", P2: ptr("Автор \"Отцы и дети\"")},
{P0: 8, P1: "Михаил Лермонтов", P2: nil},
{P0: 9, P1: "Даниил Хармс", P2: ptr("Абсурдист, писатель и поэт")},
{P0: 10, P1: "Максим Горький", P2: ptr("Автор \"На дне\"")},
{P0: 11, P1: "Владимир Маяковский", P2: nil},
{P0: 12, P1: "Сергей Есенин", P2: ptr("Русский лирик")},
{P0: 13, P1: "Борис Пастернак", P2: ptr("Автор \"Доктор Живаго\"")},
{P0: 1, P1: "Leo Tolstoy", P2: ptr("Russian writer, author of \"War and Peace\"")},
{P0: 2, P1: "Alexander Pushkin", P2: ptr("Author of \"Eugene Onegin\"")},
{P0: 3, P1: "Alexander Pushkin", P2: ptr("Russian poet, playwright, and prose writer")},
{P0: 4, P1: "Fyodor Dostoevsky", P2: ptr("Author of \"Crime and Punishment\"")},
{P0: 5, P1: "Nikolai Gogol", P2: ptr("Author of \"Dead Souls\"")},
{P0: 6, P1: "Anton Chekhov", P2: nil},
{P0: 7, P1: "Ivan Turgenev", P2: ptr("Author of \"Fathers and Sons\"")},
{P0: 8, P1: "Mikhail Lermontov", P2: nil},
{P0: 9, P1: "Daniil Kharms", P2: ptr("Absurdist, writer and poet")},
{P0: 10, P1: "Maxim Gorky", P2: ptr("Author of \"At the Bottom\"")},
{P0: 11, P1: "Vladimir Mayakovsky", P2: nil},
{P0: 12, P1: "Sergei Yesenin", P2: ptr("Russian lyric poet")},
{P0: 13, P1: "Boris Pasternak", P2: ptr("Author of \"Doctor Zhivago\"")},
}

for _, author := range authorsToInsert {
Expand Down Expand Up @@ -79,7 +79,7 @@ func TestAuthors(t *testing.T) {
var i uint64
for i = 1; i <= 13; i++ {
if err := q.DeleteAuthor(ctx, i, query.WithIdempotent()); err != nil {
t.Fatalf("failed to delete authors: %v", err)
t.Fatalf("failed to delete author: %v", err)
}
}
authors, err := q.ListAuthors(ctx)
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/ydb/catalog_tests/alter_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ func TestAlterGroup(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсинга запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -115,7 +115,7 @@ func TestAlterGroup(t *testing.T) {
cmpopts.IgnoreFields(ast.A_Const{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
10 changes: 5 additions & 5 deletions internal/engine/ydb/catalog_tests/alter_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func TestAlterUser(t *testing.T) {
Options: &ast.List{
Items: []ast.Node{
&ast.DefElem{
Defname: strPtr("rename"),
Arg: &ast.String{Str: "queen"},
Defname: strPtr("rename"),
Arg: &ast.String{Str: "queen"},
Defaction: ast.DefElemAction(1),
},
},
Expand Down Expand Up @@ -133,10 +133,10 @@ func TestAlterUser(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсинга запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -146,7 +146,7 @@ func TestAlterUser(t *testing.T) {
cmpopts.IgnoreFields(ast.A_Const{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/ydb/catalog_tests/create_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ func TestCreateGroup(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсинга запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -103,7 +103,7 @@ func TestCreateGroup(t *testing.T) {
cmpopts.IgnoreFields(ast.A_Const{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/ydb/catalog_tests/create_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ func TestCreateUser(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсинга запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -122,7 +122,7 @@ func TestCreateUser(t *testing.T) {
cmpopts.IgnoreFields(ast.DefElem{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/ydb/catalog_tests/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ func TestDelete(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсинга запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -193,7 +193,7 @@ func TestDelete(t *testing.T) {
cmpopts.IgnoreFields(ast.RangeVar{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions internal/engine/ydb/catalog_tests/drop_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ func TestDropRole(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Error parsing %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Statement %q was not parsed", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/ydb/catalog_tests/insert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ func TestInsert(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсинга запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -135,7 +135,7 @@ func TestInsert(t *testing.T) {
cmpopts.IgnoreFields(ast.RangeVar{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/ydb/catalog_tests/pragma_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ func TestPragma(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсинга запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -111,7 +111,7 @@ func TestPragma(t *testing.T) {
cmpopts.IgnoreFields(ast.A_Const{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/ydb/catalog_tests/select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ func TestSelect(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсин��а запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -390,7 +390,7 @@ func TestSelect(t *testing.T) {
cmpopts.IgnoreFields(ast.RangeVar{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/ydb/catalog_tests/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ func TestUpdate(t *testing.T) {
t.Run(tc.stmt, func(t *testing.T) {
stmts, err := p.Parse(strings.NewReader(tc.stmt))
if err != nil {
t.Fatalf("Ошибка парсинга запроса %q: %v", tc.stmt, err)
t.Fatalf("Failed to parse query %q: %v", tc.stmt, err)
}
if len(stmts) == 0 {
t.Fatalf("Запрос %q не распарсен", tc.stmt)
t.Fatalf("Query %q was not parsed", tc.stmt)
}

diff := cmp.Diff(tc.expected, &stmts[0],
Expand All @@ -178,7 +178,7 @@ func TestUpdate(t *testing.T) {
cmpopts.IgnoreFields(ast.RangeVar{}, "Location"),
)
if diff != "" {
t.Errorf("Несовпадение AST (-ожидалось +получено):\n%s", diff)
t.Errorf("AST mismatch for %q (-expected +got):\n%s", tc.stmt, diff)
}
})
}
Expand Down
Loading