2 Getting Started with DuckDB

 

This chapter covers

  • Installing and learning how to use the DuckDB CLI
  • Executing commands in the DuckDB CLI
  • Querying remote files

Now that we’ve got an understanding of what DuckDB is and why it’s come into prominence in the early 2020s, it’s time to get familiar with it. This chapter will be centered around the DuckDB CLI. We’ll learn how to install it on various environments, before learning about the in-built commands. We’ll conclude by querying a remote CSV file.

2.1 Supported environments

DuckDB is available for a range of different programming languages and operating systems (Linux, Windows, macOS) both for Intel/AMD and ARM architectures. At the time of writing, there is support for the command line, Python, R, Java, Javascript, Go, Rust, Node.js, Julia, C/C++, ODBC, JDBC, WASM, and Swift. In this chapter, we will focus on the DuckDB command line exclusively, as we think that is the easiest way to get you up to speed.

The DuckDB CLI does not require a separate server installation as DuckDB is an embedded database and in the case of the CLI, it is embedded in exactly that.

The command line tool is published to GitHub releases and there are a variety of different packages for different operating systems and architectures. You can find the full list on the installation page.

2.2 Installing the DuckDB CLI

 
 

2.2.1 macOS

 

2.2.2 Linux and Windows

 

2.3 Using the DuckDB CLI

 
 
 

2.3.1 Dot commands

 
 
 
 

2.3.2 CLI arguments

 
 
 

2.4 DuckDB’s extension system

 
 

2.5 Analyzing a CSV file with the DuckDB CLI

 
 
 

2.5.1 Result modes

 
 

2.6 Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest