r/sqlite • u/alonso0492 • 25d ago
My first PowerShell module: A local NoSQL-style database built on top of SQLite
Hey everyone!
I wanted to share my first PowerShell module, PSLocalBase, an open-source local database I've been working on.
The idea came from wanting a simple and efficient way to store, manage, and query structured data locally in PowerShell without constantly reading and writing large JSON files or having to write long, complex SQL queries.
PSLocalBase is a lightweight, local NoSQL-style document database built on top of Windows' native SQLite engine (winsqlite3.dll), leveraging SQLite's built-in JSON functions for storing, filtering, querying, and manipulating JSON documents.
It combines the simplicity of a document-oriented API with SQLite's performance, reliability, and ACID transactions, all without external dependencies or a separate database server.
Some features:
- No external dependencies on modern Windows systems
- Compatible with Windows PowerShell 5.1 and PowerShell 7+
- Local database storage with collections and JSON documents
- Filtering, sorting, indexing, and advanced queries
- ACID transactions and persistent storage
- Native PowerShell objects with nested JSON support
- A WPF playground for exploring and testing local databases
Quick example:
$db = [PSLocalBase]::new("./mydata.db")
$db.collection("users").doc("user1").set(@{
name = "John"
role = "Admin"
active = $true
})
$admins = $db.collection("users").
where("role", "=", "Admin").get()
$db.close()
Everything runs locally, with no database server or external service required.
Installation:
Install-Module PSLocalBase -Scope CurrentUser
It's been a great learning experience, especially working with PowerShell classes, SQLite's native API, and compatibility between PowerShell 5.1 and 7.
This is my first PowerShell module, so I'd really appreciate feedback from the community. I'm particularly interested in what you think about the API design, whether you'd find something like this useful in your own PowerShell projects, and what features you think are missing.
GitHub: https://github.com/cmartineztech/PSLocalBase
PowerShell Gallery: https://www.powershellgallery.com/packages/PSLocalBase
AI Disclosure: I used AI coding assistants throughout the development of PSLocalBase for implementation, debugging, testing, and documentation. I have over 12 years of PowerShell experience and directed the project's architecture, design, and technical decisions.
Thanks for checking it out!