1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-18 22:48:02 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Mohammad Alyetama
b7ed1cb632 Merge bc767a0ad3 into a92af09fea 2024-12-18 08:51:14 +05:45
jbranchaud
a92af09fea Add Explore The Database Schema as a SQLite TIL 2024-12-17 12:28:13 -06:00
Mohammad Alyetama
bc767a0ad3 Update bew cask command 2022-11-24 17:49:13 -05:00
3 changed files with 34 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
_1540 TILs and counting..._
_1541 TILs and counting..._
---
@@ -1360,6 +1360,7 @@ _1540 TILs and counting..._
### SQLite
- [Display Results In Readable Column Format](sqlite/display-results-in-readable-column-format.md)
- [Explore The Database Schema](sqlite/explore-the-database-schema.md)
### Streaming

View File

@@ -0,0 +1,31 @@
# Explore The Database Schema
The first thing I like to do when connecting to a database is get a quick lay
of the land. What are the tables and what do they look like?
I can list all tables with the `.tables` dot-command.
```sql
sqlite> .tables
ingredient_amounts ingredients recipes
```
I can then look at the `create table` statement for specific tables to see what
their schema looks like:
```sql
sqlite> .schema recipes
CREATE TABLE recipes (
id integer primary key,
name varchar not null,
description text not null,
instructions text not null
);
```
The `.schema` dot-command can also be used without any argument and it will
display the schema for all tables of all connected databases.
Run `.help` from the `sqlite3` prompt for more dot-command options.
[source](https://www.sqlite.org/cli.html#querying_the_database_schema)

View File

@@ -6,7 +6,7 @@ convert it using the `ebook-convert` binary from `Calibre`.
First, install `Calibre`:
```bash
$ brew cask install calibre
$ brew install --cask calibre
```
Then convert your ePub using `ebook-convert`: