Skip to content

Commit 5d3dd59

Browse files
committed
refactored examples
1 parent 56b0777 commit 5d3dd59

File tree

8 files changed

+46
-10
lines changed

8 files changed

+46
-10
lines changed

.github/workflows/examples.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,46 @@ on:
88
workflow_dispatch:
99
jobs:
1010
basic-ydb:
11+
concurrency:
12+
group: basic-ydb-${{ github.ref }}-${{ matrix.ydb-version }}-${{ matrix.application }}
13+
cancel-in-progress: true
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
ydb-version: [ 24.1, 24.2, 24.3 ]
19+
application: [ native/table, native/query ]
20+
services:
21+
ydb:
22+
image: ydbplatform/local-ydb:${{ matrix.ydb-version }}
23+
ports:
24+
- 2135:2135
25+
- 2136:2136
26+
- 8765:8765
27+
volumes:
28+
- /tmp/ydb_certs:/ydb_certs
29+
env:
30+
YDB_LOCAL_SURVIVE_RESTART: true
31+
YDB_USE_IN_MEMORY_PDISKS: true
32+
YDB_TABLE_ENABLE_PREPARED_DDL: true
33+
options: '-h localhost'
34+
env:
35+
OS: ubuntu-latest
36+
GO: 1.23.x
37+
YDB_CONNECTION_STRING: grpc://localhost:2136/local
38+
YDB_ANONYMOUS_CREDENTIALS: 1
39+
YDB_VERSION: ${{ matrix.ydb-version }}
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
- name: Install Go
44+
uses: actions/setup-go@v5
45+
with:
46+
cache: true
47+
- name: Run basic example ${{ matrix.application }}
48+
working-directory: ./examples/basic/${{ matrix.application }}
49+
run: go run .
50+
basic-ydb-database-sql:
1151
concurrency:
1252
group: basic-ydb-${{ github.ref }}-${{ matrix.ydb-version }}-${{ matrix.application }}-${{ matrix.query_service }}
1353
cancel-in-progress: true
@@ -16,8 +56,8 @@ jobs:
1656
fail-fast: false
1757
matrix:
1858
ydb-version: [ 24.1, 24.2, 24.3 ]
19-
application: [ native/table, native/query, database_sql, gorm, xorm ]
20-
query_service: [ 0, 1 ]
59+
application: [ database/sql, gorm, xorm ]
60+
query_service: [ true, false ]
2161
services:
2262
ydb:
2363
image: ydbplatform/local-ydb:${{ matrix.ydb-version }}

SQL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,4 +651,4 @@ db := sql.OpenDB(connector)
651651
652652
## Example of usage <a name="example"></a>
653653
654-
[Basic example](https://github.com/ydb-platform/ydb-go-examples/tree/master/basic) about series written with `database/sql` driver for `YDB` placed in [examples repository](https://github.com/ydb-platform/ydb-go-examples/tree/master/database_sql)
654+
[Basic example](https://github.com/ydb-platform/ydb-go-sdk/tree/master/examples/basic/native/query) about series written with `database/sql` driver for `YDB` placed in [examples repository](https://github.com/ydb-platform/ydb-go-sdk/tree/master/examples/database/sql)

examples/basic/database_sql/data.go renamed to examples/basic/database/sql/data.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
database_sql
3-
*/
4-
51
package main
62

73
import (

examples/basic/database_sql/main.go renamed to examples/basic/database/sql/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func main() {
3131
}
3232
defer func() { _ = cc.Close(ctx) }()
3333

34-
prefix := path.Join(cc.Name(), "database_sql")
34+
prefix := path.Join(cc.Name(), "database/sql")
3535

3636
c, err := ydb.Connector(cc,
3737
ydb.WithAutoDeclare(),

topic/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Go Report Card](https://goreportcard.com/badge/github.com/ydb-platform/ydb-go-sdk/v3)](https://goreportcard.com/report/github.com/ydb-platform/ydb-go-sdk/v3)
88
[![codecov](https://codecov.io/gh/ydb-platform/ydb-go-sdk/branch/master/graph/badge.svg?precision=2)](https://app.codecov.io/gh/ydb-platform/ydb-go-sdk)
99
![Code lines](https://sloc.xyz/github/ydb-platform/ydb-go-sdk/?category=code)
10-
[![View examples](https://img.shields.io/badge/learn-examples-brightgreen.svg)](https://github.com/ydb-platform/ydb-go-examples/tree/master/topic)
10+
[![View examples](https://img.shields.io/badge/learn-examples-brightgreen.svg)](https://github.com/ydb-platform/ydb-go-sdk/tree/master/examples/topic)
1111
[![Telegram](https://img.shields.io/badge/chat-on%20Telegram-2ba2d9.svg)](https://t.me/YDBPlatform)
1212
[![WebSite](https://img.shields.io/badge/website-ydb.tech-blue.svg)](https://ydb.tech)
1313

topic/topicreader/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Package topicreader provide Reader to receive messages from YDB topics
22
// More examples in examples repository
33
//
4-
// https://github.com/ydb-platform/ydb-go-examples/tree/master/topic/topicreader
4+
// https://github.com/ydb-platform/ydb-go-sdk/tree/master/examples/topic/topicreader
55
package topicreader

0 commit comments

Comments
 (0)