Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions go/database/sql/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestWithComment_NoContext(t *testing.T) {
Config: core.CommenterConfig{EnableDBDriver: true},
},
query: "SELECT 1;",
wantQuery: "SELECT 1/*db_driver=database%2Fsql%3A*/;",
wantQuery: "SELECT 1/*db_driver='database%2Fsql%3A'*/;",
},
{
desc: "enable DBDriver and pass static tag driver name",
Expand All @@ -50,7 +50,7 @@ func TestWithComment_NoContext(t *testing.T) {
Tags: core.StaticTags{DriverName: "postgres"},
},
query: "SELECT 1;",
wantQuery: "SELECT 1/*db_driver=database%2Fsql%3Apostgres*/;",
wantQuery: "SELECT 1/*db_driver='database%2Fsql%3Apostgres'*/;",
},
{
desc: "enable DBDriver and pass all static tags",
Expand All @@ -59,7 +59,7 @@ func TestWithComment_NoContext(t *testing.T) {
Tags: core.StaticTags{DriverName: "postgres", Application: "app-1"},
},
query: "SELECT 1;",
wantQuery: "SELECT 1/*db_driver=database%2Fsql%3Apostgres*/;",
wantQuery: "SELECT 1/*db_driver='database%2Fsql%3Apostgres'*/;",
},
{
desc: "enable other tags and pass all static tags",
Expand All @@ -68,7 +68,7 @@ func TestWithComment_NoContext(t *testing.T) {
Tags: core.StaticTags{DriverName: "postgres", Application: "app-1"},
},
query: "SELECT 1;",
wantQuery: "SELECT 1/*application=app-1,db_driver=database%2Fsql%3Apostgres*/;",
wantQuery: "SELECT 1/*application='app-1',db_driver='database%2Fsql%3Apostgres'*/;",
},
}
for _, tc := range testCases {
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestWithComment_WithContext(t *testing.T) {
},
),
query: "SELECT 1;",
wantQuery: "SELECT 1/*application=app-1,db_driver=database%2Fsql%3Apostgres,framework=custom-golang,route=listData*/;",
wantQuery: "SELECT 1/*application='app-1',db_driver='database%2Fsql%3Apostgres',framework='custom-golang',route='listData'*/;",
},
{
desc: "only all options but context contains all tags",
Expand All @@ -147,7 +147,7 @@ func TestWithComment_WithContext(t *testing.T) {
},
),
query: "SELECT 1;",
wantQuery: "SELECT 1/*action=any+action,application=app-1,db_driver=database%2Fsql%3Apostgres,framework=custom-golang,route=listData*/;",
wantQuery: "SELECT 1/*action='any+action',application='app-1',db_driver='database%2Fsql%3Apostgres',framework='custom-golang',route='listData'*/;",
},
}
for _, tc := range testCases {
Expand Down
2 changes: 1 addition & 1 deletion go/database/sql/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/google/sqlcommenter/go/database/sql

go 1.19

require github.com/google/sqlcommenter/go/core v0.1.0
require github.com/google/sqlcommenter/go/core v0.1.2

require go.opentelemetry.io/otel v1.11.1 // indirect

Expand Down
6 changes: 6 additions & 0 deletions go/database/sql/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ github.com/google/sqlcommenter/go/core v0.0.5-beta h1:axqYR1zQCCdRBLnwr/j+ckllBS
github.com/google/sqlcommenter/go/core v0.0.5-beta/go.mod h1:GORu2htXRC4xtejBzOa4ct1L20pohP81DFNYKdCJI70=
github.com/google/sqlcommenter/go/core v0.1.0 h1:g5jL8HUk2Ko9mMPoCI4jP47dyJhpNyu6E8WmiEhh8OU=
github.com/google/sqlcommenter/go/core v0.1.0/go.mod h1:GORu2htXRC4xtejBzOa4ct1L20pohP81DFNYKdCJI70=
github.com/google/sqlcommenter/go/core v0.1.1 h1:DXaWbnQHJ00RqqGiyySPnaNHLqWuemtdP1DIheVXa/A=
github.com/google/sqlcommenter/go/core v0.1.1/go.mod h1:GORu2htXRC4xtejBzOa4ct1L20pohP81DFNYKdCJI70=
github.com/google/sqlcommenter/go/core v0.1.2-beta h1:fDg7rYUmqO1UJ3SqvDDEB7Wc0kDjpzgS81VGhcJTkoI=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you see why this beta dependency is there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Ran go mod tidy.

github.com/google/sqlcommenter/go/core v0.1.2-beta/go.mod h1:GORu2htXRC4xtejBzOa4ct1L20pohP81DFNYKdCJI70=
github.com/google/sqlcommenter/go/core v0.1.2 h1:UM3jS7JROrPTsJxbLq68PRB34Iq8H3AZQDQUSV7sQWU=
github.com/google/sqlcommenter/go/core v0.1.2/go.mod h1:GORu2htXRC4xtejBzOa4ct1L20pohP81DFNYKdCJI70=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4=
Expand Down