dbedit

command
v0.0.0-...-0ca2577 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

Dbedit is an interactive editor for editing databases implementing storage.DB.

Usage:

dbedit database

At the > prompt, the following commands are supported:

get(key [, end])
hex(key [, end])
list(start, end)
set(key, value)
delete(key [, end])
mvprefix(old, new)

Get prints the value associated with the given key. If the end argument is given, get prints all key, value pairs with key k satisfying key ≤ k ≤ end.

Hex is similar to get but prints hexadecimal dumps of the values instead of using value syntax.

List lists all known keys k such that start ≤ k < end, but not their values.

Set sets the value associated with the given key.

Delete deletes the entry with the given key, printing an error if no such entry exists. If the end argument is given, delete deletes all entries with key k satisfying key ≤ k ≤ end.

Mvprefix replaces every database entry with a key starting with old by an entry with a key starting with new instead (s/old/new/).

Each of the key, value, start, and end arguments can be a Go quoted string or else a Go expression o(list) denoting an an ordered code value encoding the values in the argument list. The values in the list can be:

  • a string value: a Go quoted string
  • an ordered.Infinity value: the name Inf.
  • an integer value: a possibly-signed integer literal
  • a float64 value: a floating-point literal number (including a '.', 'e', or ,'p')
  • a float64 value: float64(f) where f is an integer or floating-point literal or NaN, Inf, +Inf, or -Inf
  • a float32 value: float32(f) where f is an integer or floating-point literal or NaN, Inf, +Inf, or -Inf
  • rev(x) where x is one of the preceding choices, for a reverse-ordered value

Note that Inf is an ordered infinity, while float64(Inf) is a floating-point infinity.

The command output uses the same syntax to print keys and values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL