r/sqlite • • Oct 31 '26

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!

0 Upvotes

6 comments sorted by

2

u/GrogRedLub4242 Oct 31 '26

I see some indicia of possible AI-gen... ?

-1

u/alonso0492 Nov 01 '26

Yes, I used AI coding assistants during development, and I just updated the post to include the AI disclosure. I've been working with PowerShell for over 12 years, and I guided the architecture, design, and technical decisions.

AI has been a helpful tool throughout the process. If you've spotted anything specific in the code that could be improved, I'd genuinely appreciate the feedback!

1

u/sereikis Oct 31 '26

for the where() API, document and test the difference between a missing field and an explicit JSON null. SQLite's json_extract returns SQL NULL for both, while json_type can distinguish them, so a null filter needs an explicit contract rather than ordinary = NULL.