github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/repo/testdb/exist.go (about)

     1  package testdb
     2  
     3  import "github.com/DATA-DOG/go-sqlmock"
     4  
     5  // RowWhenObjectExist represents a sql row when object exist.
     6  func RowWhenObjectExist() *sqlmock.Rows {
     7  	return sqlmock.NewRows([]string{""}).AddRow("1")
     8  }
     9  
    10  // RowCount represents a sql row when count query is executed.
    11  func RowCount(totalCount int) *sqlmock.Rows {
    12  	return sqlmock.NewRows([]string{"count"}).AddRow(totalCount)
    13  }
    14  
    15  // RowWhenObjectDoesNotExist represents a sql row when object does not exist.
    16  func RowWhenObjectDoesNotExist() *sqlmock.Rows {
    17  	return sqlmock.NewRows([]string{""})
    18  }