Replace `better-sqlite3` with `node:sqlite` in “Creating your own federated microblog” tutorial
Background
The current Creating your own federated microblog tutorial uses better-sqlite3, a third-party package, for SQLite database operations.
With recent developments in JavaScript runtimes providing native SQLite support, we should update the tutorial to use built-in modules instead of external dependencies.
Proposed Solution
Replace better-sqlite3 with Node.js's built-in node:sqlite module (available since v22).
Benefits
- Reduced dependencies: Eliminates the need for external packages
- Better performance: Native modules typically offer better performance
- Simplified setup: No need to install and manage third-party packages
- Future-proof: Aligns with the direction of JavaScript runtimes providing built-in database support
- Consistency: Matches the approach we're taking in other tutorials
Implementation Notes
- Update all SQLite-related code to use
node:sqlitemodule - Remove
better-sqlite3from package dependencies - Update installation and setup instructions
- Ensure minimum Node.js version requirement is v22+
Impact
This change will modernize the tutorial, reduce external dependencies, and provide a more streamlined developer experience while maintaining full functionality for Node.js users.
이미 sqlite3로 튜토리얼을 진행하긴했는데 node:sqlite로 다시 하면서 문서 수정해보고 싶습니다! 제가 해봐도될까요?
I already went through the tutorial using sqlite3, i would like to try it again using node:sqlite! Is it okay if I give it a try
@hjleee93 물론이죠! 이슈 할당해 드렸습니다.
Of course! I've assigned the issue for you.
Would it be okay to remove all the sqlite3-related parts from the tutorials? or should I leave them? @dahlia
Are you referring to better-sqlite3 when you say sqlite3?
I apologize. YES better-sqlite3 starting from line 684. It is already mentioned. but i wanna make sure:)
Yeah, those examples using better-sqlite3 should be completely replaced by node:sqlite. Note that those two modules have different APIs, so you don't have to only change imports, but also the actual API usages!
Sure, thank you!! 감사합니다
@hjleee93 This issue has been assigned for over two weeks without updates. Please provide a status update, or unassign yourself if you're unable to continue working on it.
@hjleee93 This issue has been assigned for over two weeks without updates. Please provide a status update, or unassign yourself if you're unable to continue working on it.