

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 7
click for more info
Not enough gems
Cost: 6 gems
1: Aggregate
incomplete
2: Posts
incomplete
3: Docs
incomplete
4: Submit Your Repo!
incomplete
This lesson's interactive features are locked, please to keep using them
Time to actually store the posts in the database! We'll also add a browse command to view all the posts from the feeds the user follows, right in the terminal!
A post is a single entry from a feed. It should have:
id - a unique identifier for the postcreated_at - the time the record was createdupdated_at - the time the record was last updatedtitle - the title of the posturl - the URL of the post (this should be unique)description - the description of the postpublished_at - the time the post was publishedfeed_id - the ID of the feed that the post came fromSome of these fields can probably be null, others you might want to be more strict about - it's up to you.
Again, no CLI tests for this one. Play around with the program and make sure everything works as intended!
database/sql nullable types in sqlc, like sql.NullString and sql.NullTime.published_at into a sql.NullTime. If parsing fails, leave it invalid instead of crashing the scraper.