mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-04 19:41:26 -05:00
update code blocks to always specify syntax, fix ordered list (#3734)
This commit is contained in:
@@ -14,7 +14,7 @@ You can enable this support by placing a *.nomsconfig* config file (like the [on
|
||||
|
||||
This example defines a simple [.nomsconfig](.nomsconfig) to try:
|
||||
|
||||
```
|
||||
```shell
|
||||
# Default database URL to be used whenever a database is not explictly provided
|
||||
[db.default]
|
||||
url = "ldb:.noms/tour"
|
||||
@@ -48,7 +48,7 @@ Dot (`.`) shorthand:
|
||||
|
||||
You can kick the tires by running noms commands from this directory. Here are some examples and what to expect:
|
||||
|
||||
```
|
||||
```shell
|
||||
noms ds # -> noms ds ldb:.noms/tour
|
||||
noms ds default # -> noms ds ldb:.noms/tour
|
||||
noms ds origin # -> noms ds http://demo.noms.io/cli-tour
|
||||
|
||||
@@ -4,7 +4,7 @@ Imports a CSV file as `List<T>` where `T` is a struct with fields corresponding
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
```shell
|
||||
$ cd csv-import
|
||||
$ go build
|
||||
$ ./csv-import <PATH> http://localhost:8000::foo
|
||||
@@ -21,7 +21,7 @@ Export a dataset in CSV format to stdout with column headers.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
```shell
|
||||
$ cd csv-export
|
||||
$ go build
|
||||
$ ./csv-export http://localhost:8000:foo
|
||||
|
||||
@@ -4,7 +4,7 @@ This is a small command line application that manages a very simple hypothetical
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
```shell
|
||||
go build
|
||||
./hr --ds /tmp/my-noms::hr add-person 42 Abigail Architect
|
||||
./hr --ds /tmp/my-noms::hr add-person 43 Samuel "Chief Laser Operator"
|
||||
|
||||
@@ -7,7 +7,7 @@ This program experiments with using ordinary Noms Maps as indexes. It leverages
|
||||
|
||||
###Building Indexes
|
||||
Nomdex constructs indexes as Maps that are keyed by either Strings or Numbers. The values in the index are sets of objects. The following command can be used to build an index:
|
||||
```
|
||||
```shell
|
||||
nomdex up --in-path <absolute noms path> --by <relative noms path> --out-ds <dataset name>
|
||||
```
|
||||
The ***'in-path'*** argument must be a ValueSpec(see [Spelling In Noms](../../../doc/spelling.md#spelling-values)) that designates the root of an object hierarchy to be scanned for "indexable" objects.
|
||||
@@ -20,7 +20,7 @@ In addition, there are arguments that allow values to be transformed before usin
|
||||
|
||||
### Queries in Nomdex
|
||||
Once an index is built, it can be queried against using the nomdex find command. For example, given a database that contains structs of the following type representing cities:
|
||||
```
|
||||
```go
|
||||
struct Row {
|
||||
City: String,
|
||||
State: String,
|
||||
@@ -31,14 +31,14 @@ struct Row {
|
||||
}
|
||||
```
|
||||
The following commands could be used to build indexes on the City, State, Latitude and Longitude attibutes.
|
||||
```
|
||||
```shell
|
||||
nomdex up --in-path http://localhost:8000::cities --by .City --out-ds by-name
|
||||
nomdex up --in-path http://localhost:8000::cities --by .State --out-ds by-state
|
||||
nomdex up --in-path http://localhost:8000::cities --by .GeoPos.Latitude --out-ds by-lat
|
||||
nomdex up --in-path http://localhost:8000::cities --by .GeoPos.Longitude --out-ds by-lon
|
||||
```
|
||||
Once these indexes are created, the following queries could be made using the find command:
|
||||
```
|
||||
```shell
|
||||
// find all cities in California
|
||||
nomdex find --db http://localhost:8000 'by-state = "California"'
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Build with `go build` (or just run with `go run nomsfs.go`); test with `go test`
|
||||
|
||||
Mount an existing or new dataset by executing `nomsfs`:
|
||||
|
||||
```
|
||||
```shell
|
||||
$ mkdir /var/tmp/mnt
|
||||
$ go run nomsfs.go /var/tmp/nomsfs::fs /var/tmp/mnt
|
||||
running...
|
||||
@@ -30,7 +30,7 @@ Use ^C to stop `nomsfs`
|
||||
1. Once you have a mount point and `nomsfs` is running you can add/delete/rename files and directories using the Finder or the command line as you would with any other file system.
|
||||
2. Stop `nomsfs` with ^C
|
||||
3. Let's look around the dataset:
|
||||
```
|
||||
```shell
|
||||
> noms ds /var/tmp/nomsfs
|
||||
fs
|
||||
> noms show /var/tmp/nomsfs::fs
|
||||
|
||||
Reference in New Issue
Block a user