Skip to content

Commit

Permalink
Make most bash blocks one-liners
Browse files Browse the repository at this point in the history
  • Loading branch information
szarnyasg committed May 14, 2024
1 parent 7992e22 commit 5efdf15
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 28 deletions.
3 changes: 1 addition & 2 deletions docs/api/odbc/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ sudo yum install unixODBC
To extract them, run:

```bash
mkdir duckdb_odbc
unzip duckdb_odbc-linux-amd64.zip -d duckdb_odbc
mkdir duckdb_odbc && unzip duckdb_odbc-linux-amd64.zip -d duckdb_odbc
```

3. The `unixodbc_setup.sh` script performs the configuration of the DuckDB ODBC Driver. It is based on the unixODBC package that provides some commands to handle the ODBC setup and test like `odbcinst` and `isql`.
Expand Down
3 changes: 1 addition & 2 deletions docs/api/odbc/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ title: ODBC API on macOS
3. The archive contains the `libduckdb_odbc.dylib` artifact. To extract it to a directory, run:

```bash
mkdir duckdb_odbc
unzip duckdb_odbc-osx-universal.zip -d duckdb_odbc
mkdir duckdb_odbc && unzip duckdb_odbc-osx-universal.zip -d duckdb_odbc
```

4. There are two ways to configure the ODBC driver, either by initializing via the configuration files, or by connecting with [`SQLDriverConnect`](https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqldriverconnect-function?view=sql-server-ver16).
Expand Down
3 changes: 1 addition & 2 deletions docs/api/odbc/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Using the DuckDB ODBC API on Windows requires the following steps:
Decompress the archive to a directory (e.g., `duckdb_odbc`). For example, run:

```bash
mkdir duckdb_odbc
unzip duckdb_odbc-windows-amd64.zip -d duckdb_odbc
mkdir duckdb_odbc && unzip duckdb_odbc-windows-amd64.zip -d duckdb_odbc
```

4. The `odbc_install.exe` binary performs the configuration of the DuckDB ODBC Driver on Windows. It depends on the `Odbccp32.dll` that provides functions to configure the ODBC registry entries.
Expand Down
3 changes: 2 additions & 1 deletion docs/data/csv/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ SELECT * FROM read_csv('flights.csv',
});
```

Read a CSV from stdin, auto-infer options:

```bash
# read a CSV from stdin, auto-infer options
cat flights.csv | duckdb -c "SELECT * FROM read_csv('/dev/stdin')"
```

Expand Down
3 changes: 2 additions & 1 deletion docs/data/json/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ FROM read_json('todos.json',
completed: 'BOOLEAN'});
```

Read a JSON file from stdin, auto-infer options:

```bash
# read a JSON file from stdin, auto-infer options
cat data/json/todos.json | duckdb -c "SELECT * FROM read_json_auto('/dev/stdin')"
```

Expand Down
3 changes: 1 addition & 2 deletions docs/dev/building/build_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ sudo yum install -y git g++ cmake ninja-build openssl-devel
Ubuntu and Debian:

```bash
sudo apt-get update
sudo apt-get install -y git g++ cmake ninja-build libssl-dev
sudo apt-get update && sudo apt-get install -y git g++ cmake ninja-build libssl-dev
```

Alpine Linux:
Expand Down
12 changes: 10 additions & 2 deletions docs/dev/building/building_extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ For example, to install the [`httpfs` extension](../../extensions/httpfs), run t

```bash
GEN=ninja BUILD_HTTPFS=1 make
# for release builds
```

For release builds:

```bash
build/release/duckdb -c "INSTALL 'build/release/extension/httpfs/httpfs.duckdb_extension';"
# for debug builds
```

For debug builds:

```bash
build/debug/duckdb -c "INSTALL 'build/debug/extension/httpfs/httpfs.duckdb_extension';"
```

Expand Down
5 changes: 5 additions & 0 deletions docs/dev/building/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,10 @@ CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake

```bash
sudo apt-get install -y libssl-dev
```

Then, build with:

```bash
GEN=ninja BUILD_HTTPFS=1 make
```
14 changes: 6 additions & 8 deletions docs/dev/sqllogictest/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,36 @@ You can also skip certain queries from executing by placing `mode skip` in the f
## Triggering Which Tests to Run

When running the unittest program, by default all the fast tests are run. A specific test can be run by adding the name of the test as an argument. For the sqllogictests, this is the relative path to the test file.
To run only a single test:

```bash
# run only a single test
build/debug/test/unittest test/sql/projection/test_simple_projection.test
```

All tests in a given directory can be executed by providing the directory as a parameter with square brackets.
To run all tests in the "projection" directory:

```bash
# run all tests in the "projection" directory
build/debug/test/unittest "[projection]"
```


All tests, including the slow tests, can be run by running the tests with an asterisk.
To run all tests, including the slow tests:

```bash
# run all tests, including the slow tests
build/debug/test/unittest "*"
```

We can run a subset of the tests using the `--start-offset` and `--end-offset` parameters:
We can run a subset of the tests using the `--start-offset` and `--end-offset` parameters.
To run the tests 200..250:

```bash
# run tests the tests 200..250
build/debug/test/unittest --start-offset=200 --end-offset=250
```

These are also available in percentages:
These are also available in percentages. To run tests 10% - 20%:

```bash
# run tests 10% - 20%
build/debug/test/unittest --start-offset-percentage=10 --end-offset-percentage=20
```

Expand Down
4 changes: 1 addition & 3 deletions docs/guides/data_viewers/youplot.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ Maybe you're piping some data through `jq`. Maybe you're downloading a JSON file
Let's combine this with a quick `curl` from GitHub to see what a certain user has been up to lately.
```bash
curl -sL "https://api.github.com/users/dacort/events?per_page=100" \
| duckdb -s "COPY (SELECT type, count(*) AS event_count FROM read_json_auto('/dev/stdin') GROUP BY 1 ORDER BY 2 DESC LIMIT 10) TO '/dev/stdout' WITH (FORMAT 'csv', HEADER)" \
| uplot bar -d, -H -t "GitHub Events for @dacort"
curl -sL "https://api.github.com/users/dacort/events?per_page=100" | duckdb -s "COPY (SELECT type, count(*) AS event_count FROM read_json_auto('/dev/stdin') GROUP BY 1 ORDER BY 2 DESC LIMIT 10) TO '/dev/stdout' WITH (FORMAT 'csv', HEADER)" | uplot bar -d, -H -t "GitHub Events for @dacort"
```
![github-events](/images/guides/youplot/github-events.png)
20 changes: 15 additions & 5 deletions docs/guides/odbc/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,24 @@ The first step is to include the SQL header files:
#include <sqlext.h>
```

These files contain the definitions of the ODBC functions, as well as the data types used by ODBC. In order to be able to use these header files you have to have the `unixodbc` package installed:
These files contain the definitions of the ODBC functions, as well as the data types used by ODBC. In order to be able to use these header files you have to have the `unixodbc` package installed:

On macOS:

```bash
brew install unixodbc
# or
sudo apt-get install unixodbc-dev
# or
sudo yum install unixODBC-devel
```

On Ubuntu and Debian:

```bash
sudo apt-get install -y unixodbc-dev
```

On Fedora, CentOS, and Red Hat:

```bash
sudo yum install -y unixODBC-devel
```

Remember to include the header file location in your `CFLAGS`.
Expand Down

0 comments on commit 5efdf15

Please sign in to comment.