nushell/crates/nu-command/tests/format_conversions
Vincenzo Carlino 92c4097f8d
Rename to url command to url build-query (#7702)
# Description

Refactor command: "to url" in: "to url query". Changed usage sentence.
Closes: #7495

# User-Facing Changes

Now we get a query string from a record or table by using command: "to
url query".

```
> help to url query
Convert record or table into query string applying percent-encoding.

Usage:
  > to url query

Flags:
  -h, --help - Display the help message for this command

Signatures:
  <record> | to url query -> <string>
  <table> | to url query -> <string>

Examples:
  Outputs a query string representing the contents of this record
  > { mode:normal userid:31415 } | to url query

  Outputs a query string representing the contents of this 1-row table
  > [[foo bar]; ["1" "2"]] | to url query

  Outputs a query string representing the contents of this record
  > {a:"AT&T", b: "AT T"} | to url query
```

# Tests + Formatting

Added this test:
```
Example {
    description: "Outputs a query string representing the contents of this record",
    example: r#"{a:"AT&T", b: "AT T"} | to url query"#,
    result: Some(Value::test_string("a=AT%26T&b=AT+T")),
},
```
to ensure percent-encoding. 

# After Submitting

If PR is accepted I'll open another PR on documentation to notify
changes on
[this.](https://github.com/nushell/nushell.github.io/blob/main/book/commands/to_url.md)
2023-01-15 10:16:29 -08:00
..
bson.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
csv.rs make first behave same way as last: always return list when with number argument (#6616) 2022-09-28 17:08:17 -05:00
eml.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
html.rs add input_output_types() to benchmark,cd and config reset (#7455) 2022-12-13 06:10:55 -06:00
ics.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
json.rs Fixed json parsing (#7175) 2022-11-23 17:00:00 +13:00
markdown.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
mod.rs Initial SQLite functionality (#5182) 2022-04-13 20:15:02 -07:00
nuon.rs Fix quoting of empty string in to nuon (#7632) 2022-12-30 09:49:35 +01:00
ods.rs refactor: change column names from 'Column*' to 'column*' (#4556) 2022-02-19 19:26:47 -05:00
ssv.rs refactor: change column names from 'Column*' to 'column*' (#4556) 2022-02-19 19:26:47 -05:00
toml.rs Fix typos by codespell (#7600) 2022-12-26 02:31:26 -05:00
tsv.rs make first behave same way as last: always return list when with number argument (#6616) 2022-09-28 17:08:17 -05:00
url.rs Rename to url command to url build-query (#7702) 2023-01-15 10:16:29 -08:00
vcf.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
xlsx.rs refactor: change column names from 'Column*' to 'column*' (#4556) 2022-02-19 19:26:47 -05:00
xml.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
yaml.rs Fix and Allow Number and Boolean type to be key in from yaml (#7607) 2022-12-27 08:28:24 -08:00