To exit the CLI, press Ctrl-D if your platform supports it. The CLI supports all of DuckDB’s rich SQL syntax including SELECT, CREATE, and ALTER statements, etc. If a semicolon is omitted, hitting enter will allow for multi-line SQL statements to be entered.ĭ SELECT > 'nicely formatted quack' AS my_column, > 'excited quacking' AS another_column my_column Results will be displayed in a table in the terminal. Once the CLI has been opened, enter a SQL statement followed by a semicolon, then hit enter and it will be executed. Use ".open FILENAME" to reopen on a persistent database. v0.3.4 662041e2bĬonnected to a transient in-memory database. You will see a prompt like the below, with a D on the final line. The file may have any arbitrary extension, but. This path can point to an existing database or to a file that does not yet exist and DuckDB will open or create a database at that location as needed. To open or create a persistent database, simply include a path as a command line argument like duckdb path/to/my_database.duckdb. To see additional command line options to use when starting the CLI, use the command duckdb -help.īy default, the CLI will open a temporary in-memory database. If in a PowerShell or POSIX shell environment, use the command. Navigate to that directory in a terminal and enter the command duckdb to run the executable. Once the CLI executable has been downloaded, unzip it and save it to any directory. The DuckDB CLI is based on the SQLite command line shell, so CLI-client-specific functionality is similar to what is described in the SQLite documentation (although DuckDB’s SQL syntax follows PostgreSQL conventions). Please see the installation page under the CLI tab, or download the version for your environment from the DuckDB GitHub releases page (in the “Assets” section).įor pre-release versions, you may compile from source, or download the executable file that is produced from GitHub Actions: It is precompiled for Windows, Mac, and Linux. The DuckDB CLI (Command Line Interface) is a single, dependency free executable.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |