DEV Community

Cover image for Creating a database from scratch with Node.js - Day 17
Luis Felipe Ciochetta
Luis Felipe Ciochetta

Posted on

Creating a database from scratch with Node.js - Day 17

Hello folks!

Quick update on the database project:

I have refactored every single one of my statement functions.

I am reading the book "clean code" right now and I am really liking the ideas there, so I have spent some hours today just refactoring my functions.

I am now checking for errors using try catches and throwing exceptions instead of returning errors, the code is indeed a lot cleaner.

I am also trying to respect the "each function should do one thing" principle, so I am breaking down some giant functions into many little functions and trying to keep each function dealing with one abstraction level.

So yeah, I do not have anything flashy to show off today, just did some good old refactoring

Thank you for reading

If anyone wants to read the code or play around with the project, this is the repository for the database >

GitHub logo ciochetta / learndb

Database project I've created for learning purposes

and for the parser >

GitHub logo ciochetta / lql-parser

parser for my database project

Top comments (2)

Collapse
 
vikki profile image
DearVikki • Edited

Hi Luis I just wanted to send a big thanks to you!!

Your post has been incredibly inspiring as I work on my own toy database project. Its so clearly and smoothly with every related info provided! However, I see the partitioning is still on the way, haha. I'm excited to take some of your ideas and build upon them for further study.

Once again, thank you for all your hard work and best wishes to you! :D

Collapse
 
ciochetta profile image
Luis Felipe Ciochetta

hey, thank you for the kind words :)