Skip to content

Commit

Permalink
Merge pull request #1233 from ydb-platform/gorm
Browse files Browse the repository at this point in the history
upgraded gorm-driver
  • Loading branch information
asmyasnikov authored May 17, 2024
2 parents 9d88fe4 + 8e50f65 commit e3f2b5d
Show file tree
Hide file tree
Showing 24 changed files with 148 additions and 134 deletions.
2 changes: 1 addition & 1 deletion examples/auth/environ/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
defer cancel()
db, err := ydb.Open(ctx,
os.Getenv("YDB_CONNECTION_STRING"),
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/database_sql/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func main() {

cc, err := ydb.Open(ctx,
dsn,
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(fmt.Errorf("connect error: %w", err))
Expand Down
7 changes: 1 addition & 6 deletions examples/basic/gorm/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package main

import (
"context"
"log"
"os"
"time"

ydb "github.com/ydb-platform/gorm-driver"
environ "github.com/ydb-platform/ydb-go-sdk-auth-environ"
Expand All @@ -23,9 +21,6 @@ SQLITE_CONNECTION_STRING
YDB_CONNECTION_STRING`

func main() {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

cfg := &gorm.Config{
Logger: logger.Default.LogMode(logger.Error),
}
Expand All @@ -43,7 +38,7 @@ func main() {
dsn,
ydb.WithTablePathPrefix("gorm"),
ydb.With(
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
),
),
cfg,
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/native/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func main() {

db, err := ydb.Open(ctx,
dsn,
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(fmt.Errorf("connect error: %w", err))
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/native/table/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {

db, err := ydb.Open(ctx,
dsn,
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(fmt.Errorf("connect error: %w", err))
Expand Down
2 changes: 1 addition & 1 deletion examples/coordination/lock/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func main() {
defer cancel()

db, err := ydb.Open(ctx, dsn,
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(fmt.Errorf("connect error: %w", err))
Expand Down
2 changes: 1 addition & 1 deletion examples/coordination/workers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func main() {
defer cancel()

db, err := ydb.Open(ctx, dsn,
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(fmt.Errorf("connect error: %w", err))
Expand Down
2 changes: 1 addition & 1 deletion examples/ddl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
db, err := ydb.Open(ctx, dsn,
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(fmt.Errorf("connect error: %w", err))
Expand Down
2 changes: 1 addition & 1 deletion examples/decimal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
db, err := ydb.Open(ctx, dsn,
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(fmt.Errorf("connect error: %w", err))
Expand Down
2 changes: 1 addition & 1 deletion examples/describe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
db, err := ydb.Open(ctx, dsn,
environ.WithEnvironCredentials(ctx),
environ.WithEnvironCredentials(),
)
if err != nil {
panic(fmt.Errorf("connect error: %w", err))
Expand Down
37 changes: 18 additions & 19 deletions examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ module examples
go 1.21

require (
github.com/golang-jwt/jwt/v4 v4.4.3
github.com/google/uuid v1.3.0
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.0
github.com/lib/pq v1.10.2
github.com/prometheus/client_golang v1.13.0
github.com/ydb-platform/gorm-driver v0.0.5
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.1.2
github.com/ydb-platform/gorm-driver v0.1.3
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.3.0
github.com/ydb-platform/ydb-go-sdk-prometheus/v2 v2.0.1
github.com/ydb-platform/ydb-go-sdk/v3 v3.54.0
github.com/ydb-platform/ydb-go-yc v0.10.1
golang.org/x/sync v0.3.0
github.com/ydb-platform/ydb-go-sdk/v3 v3.67.0
github.com/ydb-platform/ydb-go-yc v0.12.1
golang.org/x/sync v0.7.0
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54
gorm.io/driver/postgres v1.5.0
gorm.io/driver/sqlite v1.5.0
gorm.io/gorm v1.25.1
gorm.io/gorm v1.25.10
modernc.org/sqlite v1.18.1
xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978
xorm.io/xorm v1.3.2
Expand All @@ -28,8 +28,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/goccy/go-json v0.9.11 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
Expand All @@ -52,17 +51,17 @@ require (
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/yandex-cloud/go-genproto v0.0.0-20220815090733-4c139c0154e2 // indirect
github.com/ydb-platform/ydb-go-genproto v0.0.0-20240316140903-4a47abca1cca // indirect
github.com/ydb-platform/ydb-go-yc-metadata v0.5.4 // indirect
golang.org/x/crypto v0.21.0 // indirect
github.com/ydb-platform/ydb-go-yc-metadata v0.6.1 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/grpc v1.57.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
modernc.org/cc/v3 v3.36.3 // indirect
modernc.org/ccgo/v3 v3.16.9 // indirect
Expand Down
Loading

0 comments on commit e3f2b5d

Please sign in to comment.