micro-db
micro-db is a lightweight, file-based, zero config database for nodejs.
For the full documentation please see micro-db.fabiankachlock.dev.
Navigation
Why micro-db
☁️ Lightweight
⚡️ Performant
⌛️ Instant Persistent
🔎 Debuggable
✨ Typescript Support
⚙️ Zero Config
🛠 Expandable
🔌 Easily Replaceable
Installation
🪄 Quickstart
For more information about available methods, check out the API
Patterns
Facade Pattern
micro-db encourages you, to hide bare-bones database operations, like select or update statements from the rest of you application using the Facade pattern
To implement this in your code, you can extend the MicroDBFacade class. The MicroDBFacade provides the same api as a MicroDBDriver, but all methods are protected, which means they are inaccessible from outside of the class.
The example below shows how straight forward this approach is:
Example
Example (using instance methods rather than static ones)
id-aware Records
Sometimes, you need your database records to be aware of their id. This is mainly the case, when otherwise heavy select statements are needed to query some commonly used data. Implementing this with micro-db is very easy (and works best with the Facade Pattern).
Example
Last updated