diff --git a/shared/data.go b/shared/data.go index cadf45e..63bf2d3 100644 --- a/shared/data.go +++ b/shared/data.go @@ -191,12 +191,6 @@ func OpenLocalSqliteDb() (*gorm.DB, error) { return db, nil } -// TODO: DELETE THIS METHOD -func Persist(db *gorm.DB, entry HistoryEntry) error { - db.Create(&entry) - return nil -} - func Search(db *gorm.DB, query string, limit int) ([]*HistoryEntry, error) { tokens, err := tokenize(query) if err != nil { diff --git a/shared/data_test.go b/shared/data_test.go index 6de96ce..d894709 100644 --- a/shared/data_test.go +++ b/shared/data_test.go @@ -11,7 +11,7 @@ func TestPersist(t *testing.T) { Check(t, err) entry := MakeFakeHistoryEntry("ls ~/") - Check(t, Persist(db, entry)) + db.Create(entry) var historyEntries []*HistoryEntry result := db.Find(&historyEntries) Check(t, result.Error) @@ -32,9 +32,9 @@ func TestSearch(t *testing.T) { // Insert data entry1 := MakeFakeHistoryEntry("ls /foo") - Check(t, Persist(db, entry1)) + db.Create(entry1) entry2 := MakeFakeHistoryEntry("ls /bar") - Check(t, Persist(db, entry2)) + db.Create(entry2) // Search for data results, err := Search(db, "ls", 5)