npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@velora-cms/db-adapter

v0.14.0

Published

Multi-dialect database adapter for Velora CMS (PostgreSQL, MySQL, SQLite)

Readme

@velora-cms/db-adapter

The database layer under Velora CMS: one DatabaseAdapter interface, implemented identically for PostgreSQL, MySQL, and SQLite, so nothing above it — @velora-cms/content-service, @velora-cms/server, or a plugin's SimpleStorageAPI/StructuredStorageAPI call — ever writes dialect-specific SQL or needs to know which database is active.

npm install @velora-cms/db-adapter

Who this is for

Most Velora users never touch this package: npm create velora wires up the right adapter for you from the database you pick in setup. Reach for it directly if you're building server-side tooling that needs to talk to the content database in-process (a migration script, an import job), or if you're curious what "the same behavior on three databases" actually looks like as code.

Supported databases

Three dialects ship real, tested adapters: PostgreSQLAdapter (via pg), MySQLAdapter (via mysql2), and SQLiteAdapter (via better-sqlite3). A MockAdapter is also exported for tests. Every method on DatabaseAdapter is required to behave the same way across all three real dialects before it ships — that conformance is enforced by a shared test suite (turbo run test:adapters) that runs the same assertions against all three.

import { SQLiteAdapter } from "@velora-cms/db-adapter";

const adapter = new SQLiteAdapter();
await adapter.connect({ filename: "./velora.db" });

const roots = await adapter.getRootNodes({ limit: 20 });

What's in it

DatabaseAdapter covers connection lifecycle, raw query/execute plus transactions, the content tree (getChildren, getDescendants, getAncestors, cursor-paginated, never an unbounded "load everything" call), immutable content versioning (createContent, insertContentVersion — no update method exists for a version, by design), document types, templates, assets, media, the content trash/ restore lifecycle, and the plugin field-value storage tier. It also exports applyMigrations for running per-dialect migrations and validatePluginTableSchema/validateRowData — the guardrails behind a plugin's opt-in StructuredStorageAPI table access.

Relationship to the rest of Velora

@velora-cms/content-service and @velora-cms/server are built directly on this package; plugins never see it at all — they get SimpleStorageAPI or StructuredStorageAPI from @velora-cms/plugin-sdk, which is implemented on top of this adapter without ever handing a plugin a raw connection.

Source & support

Source: velora-starter. Docs: https://docs.velora-cms.com. Apache-2.0.