# DuckDB 1.2 CLI Features That Will Make Your Life EASIER!

## Метаданные

- **Канал:** Learn Data with Mark
- **YouTube:** https://www.youtube.com/watch?v=Ih-6f9obk4s
- **Источник:** https://ekstraktznaniy.ru/video/38882

## Транскрипт

### Segment 1 (00:00 - 03:00) []

in this video we're going to look at the CLI improvements made in Duck DB 1. 2 they're mostly small improvements but they all add up let's launch duck DB 1. 1 on the left and duck DB 1. 2 on the right to explore the changes so these databases both have one table called players and the first feature we're going to look at is autocomplete for the show Clause the modifier Keys being pressed are going to be in the bottom left hand corner so in 1. 1 if we typ show and then tab it only shows us other Clauses we don't ever get the table name players in 1. 2 you see we get table and then players and we can then choose to view the schema of the table let's go back to the show command and we'll type in part of the table name so PLA and then tab a couple of times and you see it goes players and then pragma show now what if we want to go back through the suggestions to our original command we can now press shift Tab and you see it eventually gets back to show pla next we're going to look at improvements to the syntax highlighting of Errors so I'm going to write a query on a table that doesn't exist with a column that doesn't exist and you can see it comes back catalog error table with name FU does not exist and then it's got some suggestions for what to do and you can see everything is in white if we do that same query in 1. 2 on the right hand side you can see we now get a bit more coloring off the output it's a little bit easier to understand what's going on next up formatting numbers so say I write a query I want to get a count of the number of players and their average height so it comes back like this in 1. 2 we can now specify the Thousand separator so we'll put that as a space and the decimal comma and if we rerun that query you can now see that it's using those separators let's reset the separators back to the sort of British normal one so a comma for thousands and a full stop for decimals and we're going to write a new query so this time we're going to sum the player IDs and sum the D as DB is a big in for some reason and you can see because these are really big numbers on both sides it writes in 16. 46% Park file so you can see we get that coming up here now let's enable safe mode we can also do this using the hyphen safe flag when we're launching duck DB we'll now be unable to interact with the host file system so if I try and read that Park file again you see it says cannot access file system operations are disabled by configuration we can also only work with the database file that we initially connected to so that was tennis. ddb if we try to attach to another database we'll also get that same permission error okay and one more we can now have another way to execute a bunch of queries in a file so let's say we have this file query. SQL now we could execute those queries by piping that file into duck DB but from version 1. 2 we now have another option which is the hyphen f flag and if we call that you can see the queries are executed
