// SetObject creates or updates the key-value pair.
SetObject creates or updates the key-value pair.
// SetObject creates or updates the key - value pair .
func (kv *KeyValueDB) SetObject(table, id string, value interface{}) error {
	gobBuffer := new(bytes.Buffer)
	gobEncoder := gob.NewEncoder(gobBuffer)
	err := gobEncoder.Encode(value)
	if err != nil {
		return err
	}
	_, err = kv.db.Exec(
		"INSERT OR REPLACE INTO kv (table_name, id, val) VALUES(?, ?, ?);",
		table, id, gobBuffer.Bytes(),
	)
	if err != nil {
		return err
	}
	return nil
}
func ( kv * KeyValueDB ) SetObject ( table , id string , value interface { } ) error { gobBuffer := new ( bytes . Buffer ) gobEncoder := gob . NewEncoder ( gobBuffer ) err := gobEncoder . Encode ( value ) if err != nil { return err } _ , err = kv . db . Exec ( " " , table , id , gobBuffer . Bytes ( ) , ) if err != nil { return err } return nil }
SetObject creates or updates the key-value pair.
SetObject creates or updates the key - value pair .