Skip to content

Commit

Permalink
ci: add test for variable. (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Aug 28, 2024
1 parent 67f935d commit bf97a20
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,15 @@ func (s *DatabendTestSuite) TestSessionConfig() {
r.Nil(err)
r.Equal(int64(0), result)
}

func (s *DatabendTestSuite) TestSessionVariable() {
r := require.New(s.T())

var result int64

_, err := s.db.Exec("set variable a = 100")
r.Nil(err)
err = s.db.QueryRow("select $a").Scan(&result)
r.Nil(err)
r.Equal(int64(100), result)
}

0 comments on commit bf97a20

Please sign in to comment.