code: func (db *DB) Write(doc *Doc) error {
  	tx, err := db.meta.Begin()
  	if err != nil {
  		return err
  	}
  	defer tx.Rollback() // no-op if tx.Commit called already
  
  	id := doc.ID
  	if err := db.store.Insert(tx, doc); err != nil {
  		doc.ID = id
  		return err
  	}
  	txt := text{
  		ID:   doc.ID,
  		Desc: strings.ToLower(doc.Desc),
  		Text: strings.ToLower(doc.Text),
  		Tags: strings.ToLower(doc.Tags),
  	}
  	if err := db.store.Insert(tx, &txt); err != nil {
  		doc.ID = id
  		return err
  	}
  	if err := tx.Commit(); err != nil {
  		return err
  	}
  
  	return nil
  }
docs: // Write adds doc to the database, overwriting any existing
  // entry with the same doc.ID.