Hi man, first of all: thank you for your contribution for the community !
I was looking at this piece of code, and I don't understand why you import the DB and inside this code you use logic technology-specific... what's the point ?
I mean... If I need to change the data base I need to change makeDb origin, and ALSO this technology specific logic.
You can easily use a proxy to implement an adapter pattern to those changes.
You can also use tools such which make the getting into the DB very similar to all query languages, such as NanoSql and even Prisma , making your changes minimal.
You can easily use a proxy to implement an adapter pattern to those changes.
You can also use tools such which make the getting into the DB very similar to all query languages, such as NanoSql and even Prisma , making your changes minimal.
https://github.com/dev-mastery/comments-api/blob/a4e718941a32f28fae55c2ee630f85ae73d3be11/src/data-access/comments-db.js#L17
Hi man, first of all: thank you for your contribution for the community !
I was looking at this piece of code, and I don't understand why you import the DB and inside this code you use logic technology-specific... what's the point ?
I mean... If I need to change the data base I need to change makeDb origin, and ALSO this technology specific logic.
Am I right?
Thanks !