Hence, if you need a simple database for your desktop application, using sqlite is a better option than trying to cobble together something similar using your own special hash tables and b-trees. However, trying to do the latter will certainly help you understand a quite a bit about database architecture.
However, many people who say 'don't re-invent the wheel' are really saying 'you're just a worker bee and so you don't need to know anything more than how to operate this here machine' - and that's a trap, as you're then not developing your skills and knowledge to a higher level.