Skip to content

Commit

Permalink
Added 'like' into query search finder
Browse files Browse the repository at this point in the history
  • Loading branch information
grrlopes committed Jul 29, 2023
1 parent 1016e91 commit 624f71c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions repositories/isqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ type ISqliteRepository interface {
Pagination(int, int) ([]SqliteCmd, error)
Count() (int, error)
InsertParsed(string) (int64, error)
Search(string, int, int) ([]entity.SqliteCommand, int, error)
}
2 changes: 1 addition & 1 deletion repositories/sqlite/sqliterepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (sql *SQLiteRepository) Search(filter string, limit int, skip int) ([]entit

defer result.Close()

err = sql.db.QueryRow("SELECT COUNT(*) FROM command WHERE Title LIKE ?", "%"+filter+"").Scan(&count)
err = sql.db.QueryRow("SELECT COUNT(*) FROM command WHERE Title LIKE ?", "%"+filter+"%").Scan(&count)

var data []entity.SqliteCommand

Expand Down

0 comments on commit 624f71c

Please sign in to comment.