// GetObject retrieves and decodes the stored value into result.
GetObject retrieves and decodes the stored value into result.
// GetObject retrieves and decodes the stored value into result .
func (kv *KeyValueDB) GetObject(table, id string, result interface{}) (err error) {
	row := kv.db.QueryRow(
		"SELECT val FROM kv WHERE table_name = ? AND id = ?",
		table, id,
	)
	var buf []byte
	err = row.Scan(&buf)
	if err != nil {
		return err
	}
	gobBuffer := bytes.NewBuffer(buf)
	gobDecoder := gob.NewDecoder(gobBuffer)
	err = gobDecoder.Decode(result)
	return err
}
func ( kv * KeyValueDB ) GetObject ( table , id string , result interface { } ) ( err error ) { row := kv . db . QueryRow ( " " , table , id , ) var buf [ ] byte err = row . Scan ( & buf ) if err != nil { return err } gobBuffer := bytes . NewBuffer ( buf ) gobDecoder := gob . NewDecoder ( gobBuffer ) err = gobDecoder . Decode ( result ) return err }
GetObject retrieves and decodes the stored value into result.
GetObject retrieves and decodes the stored value into result .