mirror of
https://github.com/jbranchaud/til
synced 2026-01-17 05:58:01 +00:00
Compare commits
3 Commits
bad16af9db
...
92c5963ed6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92c5963ed6 | ||
|
|
a92af09fea | ||
|
|
295fe153ad |
@@ -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
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ an array-like object with all of the arguments to the function. Even if not
|
||||
all of the arguments are referenced in the function signature, they can
|
||||
still be accessed via the `arguments` object.
|
||||
|
||||
> For ES6+ compatibility, the `spread` operator used via [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters) is preferred over the `arugments` object when accessing an abritrary number of function arguments.
|
||||
|
||||
```javascript
|
||||
function argTest(one) {
|
||||
console.log(one);
|
||||
|
||||
31
sqlite/explore-the-database-schema.md
Normal file
31
sqlite/explore-the-database-schema.md
Normal 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)
|
||||
Reference in New Issue
Block a user