Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcgary committed Sep 10, 2024
1 parent 336f218 commit 8277da9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 4 additions & 0 deletions internal/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
"gorm.io/gorm/logger"
)

// bytesToHex is a custom SQLite function that converts a JSON byte array to a hex string.
//
// @param jsonByteArray: a JSON byte array, e.g. [1, 2, 3, ...]
// @return: a hex string without a leading 0x, e.g. 78cc56f0700e7ba5055f12...
func bytesToHex(jsonByteArray string) (string, error) {
jsonBytes := make([]byte, 0)
err := json.Unmarshal([]byte(jsonByteArray), &jsonBytes)
Expand Down
9 changes: 0 additions & 9 deletions internal/sqlite/sqlite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ import (
)

func Test_Sqlite(t *testing.T) {
// t.Run("Should create a new GormSqlite", func(t *testing.T) {
// s := NewSqlite("file::memory:?cache=shared")
// grm, err := NewGormSqliteFromSqlite(s)
// assert.Nil(t, err)
// assert.NotNil(t, grm)
//
// db, err := grm.DB()
// defer db.Close()
// })
t.Run("Should use the bytesToHex function", func(t *testing.T) {
query := `
with json_values as (
Expand Down

0 comments on commit 8277da9

Please sign in to comment.