Skip to content

Commit 7058dc0

Browse files
committed
Various style and formatting fixes
Fixes cockroachdb#3249. Summary of changes: - Changed all headings to sentence case - Added clipboard copy widget to code samples - Fixed a few contractions spotted by the prose linter - Fixed 2 broken diagrams which needed wrapping in `div` tags
1 parent 0a2ca85 commit 7058dc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+605
-261
lines changed

v2.1/explain.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan
88

99
<div id="toc"></div>
1010

11-
## Explainable Statements
11+
## Explainable statements
1212

1313
You can `EXPLAIN` on the following statements:
1414

@@ -33,7 +33,7 @@ You can `EXPLAIN` on the following statements:
3333
- [`UPDATE`](update.html)
3434
- [`UPSERT`](upsert.html)
3535

36-
## Query Optimization
36+
## Query optimization
3737

3838
Using `EXPLAIN`'s output, you can optimize your queries by taking the following points into consideration:
3939

@@ -70,7 +70,7 @@ The user requires the appropriate [privileges](privileges.html) for the statemen
7070

7171
{{site.data.alerts.callout_danger}}<code>EXPLAIN</code> also includes other modes besides query plans that are useful only to CockroachDB developers, which are not documented here.{{site.data.alerts.end}}
7272

73-
## Success Responses
73+
## Success responses
7474

7575
Successful `EXPLAIN` statements return tables with the following columns:
7676

@@ -84,7 +84,7 @@ Successful `EXPLAIN` statements return tables with the following columns:
8484

8585
## Examples
8686

87-
### Default Query Plans
87+
### Default query plans
8888

8989
By default, `EXPLAIN` includes the least detail about the query plan but can be
9090
useful to find out which indexes and index key ranges are used by a query:
@@ -113,7 +113,7 @@ index you are scanning (in this case, a full table scan). For more
113113
information on indexes and key ranges, see the
114114
[example](#find-the-indexes-and-key-ranges-a-query-uses) below.
115115

116-
### `EXPRS` Option
116+
### `EXPRS` option
117117

118118
The `EXPRS` option includes SQL expressions that are involved in each processing stage, providing more granular detail about which portion of your query is represented at each level:
119119

@@ -135,7 +135,7 @@ The `EXPRS` option includes SQL expressions that are involved in each processing
135135
+-----------+--------+-------------+
136136
~~~
137137

138-
### `METADATA` Option
138+
### `METADATA` option
139139

140140
The `METADATA` option includes detail about which columns are being used by each
141141
level, as well as properties of the result set on that level:
@@ -211,7 +211,7 @@ that are known to have the same value on all rows. For example:
211211
This indicates that on any row, column `a` has the same value with column `e`,
212212
and that all rows have the same value on column `c`.
213213

214-
### `QUALIFY` Option
214+
### `QUALIFY` option
215215

216216
`QUALIFY` uses `<table name>.<column name>` notation for columns in the query plan. However, `QUALIFY` must be used with `EXPRS` to show the SQL values used:
217217

@@ -261,7 +261,7 @@ You can contrast this with the same statement not including the `QUALIFY` option
261261
+-------+--------+----------+-------------+
262262
~~~
263263

264-
### `VERBOSE` Option
264+
### `VERBOSE` option
265265

266266
The `VERBOSE` option is an alias for the combination of `EXPRS`, `METADATA`, and `QUALIFY` options:
267267

@@ -294,7 +294,7 @@ The `VERBOSE` option is an alias for the combination of `EXPRS`, `METADATA`, and
294294
+---------------------+-------+--------+----------------+------------------+-----------------------+------------------------------+
295295
~~~
296296

297-
### `TYPES` Option
297+
### `TYPES` option
298298

299299
The `TYPES` mode includes the types of the values used in the query plan, and implies the `METADATA` and `EXPRS` options as well:
300300

@@ -316,7 +316,7 @@ The `TYPES` mode includes the types of the values used in the query plan, and im
316316
+-----------+-------+------+--------+-----------------------------+----------------+------------------------------+
317317
~~~
318318

319-
### Find the Indexes and Key Ranges a Query Uses
319+
### Find the indexes and key ranges a query uses
320320

321321
You can use `EXPLAIN` to understand which indexes and key ranges queries use,
322322
which can help you ensure a query isn't performing a full table scan.

v2.1/export.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Using the [CockroachDB distributed execution engine](https://www.cockroachlabs.c
1212

1313
<div id="toc"></div>
1414

15-
## Export File Location
15+
## Export file location
1616

1717
You can use remote cloud storage (Amazon S3, Google Cloud Platform, etc.) to store the exported CSV data. Alternatively, you can use an [HTTP server](create-a-file-server.html) accessible from all nodes.
1818

1919
For simplicity's sake, it's **strongly recommended** to use cloud/remote storage for the data you want to export. Local files are supported; however, they must be accessible identically from all nodes in the cluster.
2020

21-
## Cancelling Export
21+
## Cancelling export
2222

2323
After the export has been initiated, you can cancel it with [`CANCEL QUERY`](cancel-query.html).
2424

@@ -41,15 +41,15 @@ Only the `root` user can run [`EXPORT`](export.html).
4141
| `select_stmt` | Specify the query whose result you want to export to CSV format. |
4242
| `table_name` | Specify the name of the table you want to export to CSV format. |
4343

44-
### Export File URL
44+
### Export file URL
4545

4646
URLs for the file directory location you want to export to must use the following format:
4747

4848
{% include external-urls-v2.0.md %}
4949

5050
You can specify the base directory where you want to store the exported .csv files. CockroachDB will create several files in the specified directory with programmatically generated names (e.g., n1.1.csv, n1.2.csv, n2.1.csv, ...).
5151

52-
### Export Options
52+
### Export options
5353

5454
You can control the [`EXPORT`](export.html) process's behavior using any of the following key-value pairs as a `kv_option`.
5555

@@ -105,7 +105,7 @@ Convert SQL *NULL* values so they match the specified string.
105105

106106
## Examples
107107

108-
### Export a Table
108+
### Export a table
109109

110110
{% include copy-clipboard.html %}
111111
~~~ sql
@@ -114,7 +114,7 @@ Convert SQL *NULL* values so they match the specified string.
114114
WITH delimiter = '|' FROM TABLE bank.customers;
115115
~~~
116116

117-
### Export Using a `SELECT` Statement
117+
### Export using a `SELECT` statement
118118

119119
{% include copy-clipboard.html %}
120120
~~~ sql
@@ -123,14 +123,14 @@ Convert SQL *NULL* values so they match the specified string.
123123
FROM SELECT * FROM bank.customers WHERE id >= 100;
124124
~~~
125125

126-
### Non-Distributed Export Using the SQL Shell
126+
### Non-distributed export using the SQL shell
127127

128128
{% include copy-clipboard.html %}
129129
~~~ shell
130130
$ cockroach sql -e "SELECT * from bank.customers WHERE id>=100;" --format=csv > my.csv
131131
~~~
132132

133-
## Known Limitation
133+
## Known limitation
134134

135135
`EXPORT` may fail with an error if the SQL statements are incompatible with DistSQL. In that case, use the [non-enterprise feature to export tabular data in CSV format](#non-distributed-export-using-the-sql-shell).
136136

v2.1/foreign-key.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For example, if you create a foreign key on `orders.customer` that references `c
1717

1818
## Details
1919

20-
### Rules for Creating Foreign Keys
20+
### Rules for creating foreign keys
2121

2222
**Foreign Key Columns**
2323

@@ -37,7 +37,7 @@ For example, if you create a foreign key on `orders.customer` that references `c
3737
- Referenced columns must contain only unique sets of values. This means the `REFERENCES` clause must use exactly the same columns as a [Unique](unique.html) or [Primary Key](primary-key.html) constraint on the referenced table. For example, the clause `REFERENCES tbl (C, D)` requires `tbl` to have either the constraint `UNIQUE (C, D)` or `PRIMARY KEY (C, D)`.
3838
- In the `REFERENCES` clause, if you specify a table but no columns, CockroachDB references the table's primary key. In these cases, the Foreign Key constraint and the referenced table's primary key must contain the same number of columns.
3939

40-
### _NULL_ Values
40+
### _NULL_ values
4141

4242
Single-column foreign keys accept _NULL_ values.
4343

@@ -50,7 +50,7 @@ For example, if you have a Foreign Key constraint on columns `(A, B)` and try to
5050

5151
However, allowing _NULL_ values in either your foreign key or referenced columns can degrade their referential integrity. To avoid this, you can use the [Not Null constraint](not-null.html) on both sets of columns when [creating your tables](create-table.html). (The Not Null constraint cannot be added to existing tables.)
5252

53-
### Foreign Key Actions
53+
### Foreign key actions
5454

5555
When you set a foreign key constraint, you can control what happens to the constrained column when the column it's referencing (the foreign key) is deleted or updated.
5656

@@ -77,7 +77,7 @@ Foreign Key constraints can be defined at the [table level](#table-level). Howev
7777

7878
{{site.data.alerts.callout_info}}You can also add the Foreign Key constraint to existing tables through <a href="add-constraint.html#add-the-foreign-key-constraint-with-cascade"><code>ADD CONSTRAINT</code></a>.{{site.data.alerts.end}}
7979

80-
### Column Level
80+
### Column level
8181

8282
<section>{% include sql/{{ page.version.version }}/diagrams/foreign_key_column_level.html %}</section>
8383

@@ -94,6 +94,7 @@ Foreign Key constraints can be defined at the [table level](#table-level). Howev
9494

9595
**Example**
9696

97+
{% include copy-clipboard.html %}
9798
~~~ sql
9899
> CREATE TABLE IF NOT EXISTS orders (
99100
id INT PRIMARY KEY,
@@ -104,7 +105,7 @@ Foreign Key constraints can be defined at the [table level](#table-level). Howev
104105
~~~
105106
{{site.data.alerts.callout_danger}}<code>CASCADE</code> does not list objects it drops or updates, so it should be used cautiously.{{site.data.alerts.end}}
106107

107-
### Table Level
108+
### Table level
108109

109110
<section>{% include sql/{{ page.version.version }}/diagrams/foreign_key_table_level.html %}</section>
110111

@@ -120,6 +121,7 @@ Foreign Key constraints can be defined at the [table level](#table-level). Howev
120121

121122
**Example**
122123

124+
{% include copy-clipboard.html %}
123125
~~~ sql
124126
CREATE TABLE packages (
125127
customer INT,
@@ -134,9 +136,9 @@ CREATE TABLE packages (
134136
;
135137
~~~
136138

137-
## Usage Examples
139+
## Usage examples
138140

139-
### Use a Foreign Key Constraint with Default Actions
141+
### Use a foreign key constraint with default actions
140142

141143
In this example, we'll create a table with a foreign key constraint with the default [actions](#foreign-key-actions) (`ON UPDATE NO ACTION ON DELETE NO ACTION`).
142144

v2.1/frequently-asked-questions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ For more details, learn our [basic CockroachDB SQL statements](learn-cockroachdb
9292

9393
## Does CockroachDB support distributed transactions?
9494

95-
Yes. CockroachDB distributes transactions across your cluster, whether it’s a few servers in a single location or many servers across multiple datacenters. Unlike with sharded setups, you don’t need to know the precise location of data; you just talk to any node in your cluster and CockroachDB gets your transaction to the right place seamlessly. Distributed transactions proceed without downtime or additional latency while rebalancing is underway. You can even move tables – or entire databases – between data centers or cloud infrastructure providers while the cluster is under load.
95+
Yes. CockroachDB distributes transactions across your cluster, whether it’s a few servers in a single location or many servers across multiple datacenters. Unlike with sharded setups, you do not need to know the precise location of data; you just talk to any node in your cluster and CockroachDB gets your transaction to the right place seamlessly. Distributed transactions proceed without downtime or additional latency while rebalancing is underway. You can even move tables – or entire databases – between data centers or cloud infrastructure providers while the cluster is under load.
9696

9797
## Do transactions in CockroachDB guarantee ACID semantics?
9898

v2.1/functions-and-operators.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ CockroachDB supports the following SQL functions and operators for use in [scala
1010

1111
<div id="toc"></div>
1212

13-
## Special Syntax Forms
13+
## Special syntax forms
1414

1515
The following syntax forms are recognized for compatibility with the
1616
SQL standard and PostgreSQL, but are equivalent to regular built-in
1717
functions:
1818

1919
{% include sql/{{ page.version.version }}/function-special-forms.md %}
2020

21-
## Conditional and Function-Like Operators
21+
## Conditional and function-like operators
2222

2323
The following table lists the operators that look like built-in
2424
functions but have special evaluation rules:
@@ -36,11 +36,11 @@ functions but have special evaluation rules:
3636
| `NULLIF(...)` | [Return `NULL` conditionally](scalar-expressions.html#nullif-expressions) |
3737
| `ROW(...)` | [Tuple Constructor](scalar-expressions.html#tuple-constructor) |
3838

39-
## Built-in Functions
39+
## Built-in functions
4040

4141
{% include sql/{{ page.version.version }}/functions.md %}
4242

43-
## Aggregate Functions
43+
## Aggregate functions
4444

4545
{% include sql/{{ page.version.version }}/aggregates.md %}
4646

@@ -102,7 +102,7 @@ The following table lists all CockroachDB operators from highest to lowest prece
102102

103103
[Multi-valued]: scalar-expressions.html#multi-valued-comparisons
104104

105-
### Supported Operations
105+
### Supported operations
106106

107107
{% include sql/{{ page.version.version }}/operators.md %}
108108

0 commit comments

Comments
 (0)