When trying to complete stage #WS9, I’ve started to notice that the column serial type coming back for integer types has a value of 0.
For example, here are the logs when I tried to query the superheroes db file:
parseRecord {
buffer: <Buffer 08 00 45 1f 21 00 2b 15 42 61 72 6f 6e 20 42 6c 69 74 7a 6b 72 69 65 67 20 28 4e 65 77 20 45 61 72 74 68 29 42 6c 75 65 20 45 79 65 73 42 6c 61 63 6b ... 24 more bytes>,
serialType: Map(7) {
'id' => 0,
'name' => 69,
'eye_color' => 31,
'hair_color' => 33,
'appearance_count' => 0,
'first_appearance' => 43,
'first_appearance_year' => 21
},
record: Map(7) {
'id' => null,
'name' => 'Baron Blitzkrieg (New Earth)',
'eye_color' => 'Blue Eyes',
'hair_color' => 'Black Hair',
'appearance_count' => null,
'first_appearance' => '1977, September',
'first_appearance_year' => '1977'
}
}
In this example, the id and appearance_count columns have a serial type value of 0. I double-checked that this was also true when querying the file using hexdump (from the terminal).
I’ve pushed all my recent changes. To run the program with the same debugging logs, please run the program with the debug command.
e.g.
npm run debug superheroes.db "select id,name from superheroes where eye_color='Amber Eyes'"
I’ve also noticed that this was the case even when querying the sample.db.
e.g.
parseRecord {
buffer: <Buffer 04 00 2d 19 47 6f 6c 64 65 6e 20 44 65 6c 69 63 69 6f 75 73 59 65 6c 6c 6f 77>,
serialType: Map(3) { 'id' => 0, 'name' => 45, 'color' => 25 },
record: Map(3) {
'id' => null,
'name' => 'Golden Delicious',
'color' => 'Yellow'
}
}
Sorry, this could be a silly question, but I must be missing something basic here.