Skip to content

Commit

Permalink
rm comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dedekind561 committed Apr 18, 2024
1 parent b729308 commit 824b6ae
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions guides/db-setup/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,30 @@ Use the `createdb` command to create a new database called `videorec`:
createdb videorec
```

### Initial Data Load
### Create tables and load data

Populate the database with initial data:
Create tables and load the database with initial data:

```bash
psql -d videorec < db/initdb.sql
```

<details>
<summary>Let's just parse that command clearly:</summary>
#### Summary

1. `psql` : Use the PostgreSQL command-line interface.
2. `-d` : This flag marks the next argument as the database name.
3. `videorec` : The name of the database you want to populate.
4. `<` : The following file will be used as input.
5. `db/initdb.sql` : The path to the SQL file to populate the database.

</details>
<!-- {{</note>}}>-->
<hr/>
<!--{{<note type="tip" title="Connectivity">}}-->

Depending how postgresql was installed for you, you might need to add some connectivity details to both createdb and psql: `psql -h localhost -U username -d videorec < db/initdb.sql` In this example you ask postgres to connect to your local database through localhost and use username as the user.

##### Check 📝

Double-check the command you just used was successful. What should you expect to see in your local database after running this command.

<!--{{</note>}}>-->

### Backup your database

<!--{{<note type="activity" title="Backup">}}-->

Now, let's create a compressed archive of your database for safekeeping. Use the `pg_dump` command with the following options:

```bash
Expand Down Expand Up @@ -75,8 +65,6 @@ pg_dump -h localhost -U username videorec > backups/videorec_backup_$(date +"%Y-
- This command incorporates the current date in the filename for easy identification and versioning.
</details>

<!--{{</note>}}>-->

### Removing, Re-initializing, and Restoring

Now that we have a backup, let's practice removing and re-initializing the database:
Expand Down

0 comments on commit 824b6ae

Please sign in to comment.