mirror of https://github.com/perkeep/perkeep.git
mysqlindexer: implement Get, Set, Delete
Change-Id: I5670bfc9ac91044be663f248c034ae20c11562bb
This commit is contained in:
parent
cc75c449cf
commit
401f07f6cf
|
@ -47,15 +47,18 @@ func (ms *myIndexStorage) CommitBatch(b index.BatchMutation) error {
|
|||
}
|
||||
|
||||
func (ms *myIndexStorage) Get(key string) (value string, err error) {
|
||||
panic("TODO(bradfitz): implement")
|
||||
err = ms.db.QueryRow("SELECT v FROM rows WHERE k=?", key).Scan(&value)
|
||||
return
|
||||
}
|
||||
|
||||
func (ms *myIndexStorage) Set(key, value string) error {
|
||||
return errors.New("TODO(bradfitz): implement")
|
||||
_, err := ms.db.Exec("INSERT INTO rows (k, v) VALUES (?, ?)", key, value)
|
||||
return err
|
||||
}
|
||||
|
||||
func (ms *myIndexStorage) Delete(key string) error {
|
||||
return errors.New("TODO(bradfitz): implement")
|
||||
_, err := ms.db.Exec("DELETE FROM rows WHERE k=?", key)
|
||||
return err
|
||||
}
|
||||
|
||||
func (ms *myIndexStorage) Find(key string) index.Iterator {
|
||||
|
|
Loading…
Reference in New Issue