View executes a function within a managed read-only transaction.
(fn func(tx *Tx) error)
| 217 | |
| 218 | // View executes a function within a managed read-only transaction. |
| 219 | func (db *DB) View(fn func(tx *Tx) error) error { |
| 220 | if fn == nil { |
| 221 | return ErrFn |
| 222 | } |
| 223 | |
| 224 | return db.managed(false, fn) |
| 225 | } |
| 226 | |
| 227 | // Backup copies the database to file directory at the given dir. |
| 228 | func (db *DB) Backup(dir string) error { |