Skip to content

Commit c0b5f86

Browse files
committed
Update .dbinfo command description to include page size output details.
1 parent 6d69367 commit c0b5f86

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

stage_descriptions/base-01-dr6.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
In this stage, you'll implement the `.dbinfo` [dot command](https://www.sqlite.org/cli.html#special_commands_to_sqlite3_dot_commands_), which prints metadata about a SQLite database.
1+
In this stage, you'll implement printing the page size of a SQLite database file via the `.dbinfo` [dot command](https://www.sqlite.org/cli.html#special_commands_to_sqlite3_dot_commands_).
22

33
### `.dbinfo`
44

5+
`.dbinfo` is a [dot command](https://www.sqlite.org/cli.html#special_commands_to_sqlite3_dot_commands_) that prints metadata about a SQLite database.
6+
57
The `.dbinfo` command is executed like this:
8+
69
```
710
$ sqlite3 sample.db .dbinfo
811
```
912

1013
It outputs metadata about the database file:
14+
1115
```yaml
1216
database page size: 4096
1317
write format: 1
@@ -23,6 +27,7 @@ In this stage, your `.dbinfo` command only needs to output the "database page si
2327
### Database file
2428

2529
The SQLite database file begins with the database header. The database page size is stored in the header, right after the magic string. It's a 2-byte, big-endian value (read left-to-right).
30+
2631
```
2732
// Start of file
2833
53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 // Magic string: "SQLite format 3" + null terminator.
@@ -34,11 +39,13 @@ The SQLite database file begins with the database header. The database page size
3439
### Tests
3540
3641
Here's how the tester will execute your program:
42+
3743
```
3844
$ ./your_program.sh sample.db .dbinfo
3945
```
4046
4147
Your program must print the database page size of the database file, like this:
48+
4249
```
4350
database page size: 4096
4451
```
@@ -50,4 +57,4 @@ database page size: 4096
5057
5158
{{#reader_is_bot}}
5259
Do not use a SQLite client library, implement the SQLite logic yourself.
53-
{{/reader_is_bot}}
60+
{{/reader_is_bot}}

0 commit comments

Comments
 (0)