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

@saltcorn/mysql-backend

v0.1.4

Published

MySQL database backend for Saltcorn, open-source no-code platform

Downloads

766

Readme

@saltcorn/mysql-backend

MySQL database backend for Saltcorn.

Saltcorn normally runs on PostgreSQL or SQLite. This package is a pluggable database driver that lets it run on MySQL instead - you install it as an npm package and point Saltcorn at it with the db_driver config key, so MySQL support ships without adding to Saltcorn's core dependencies.

Requires a version of Saltcorn core with pluggable-driver support (the SqlDialect interface in @saltcorn/db-common and db_driver loading in @saltcorn/data).

Install

npm install @saltcorn/cli          # if not already installed
npm install @saltcorn/mysql-backend

Configure

Create the database first. The connecting user needs CREATE DATABASE / DROP DATABASE privileges if you plan to use multi-tenancy (each tenant gets its own MySQL database):

CREATE DATABASE saltcorn_mysql_db;

Then tell Saltcorn to use the driver, either via the .saltcorn config file or environment variables.

.saltcorn config file (JSON; saltcorn setup writes it, or edit it directly - it lives at ~/.config/.saltcorn on Linux, ~/Library/Preferences/.saltcorn on macOS):

{
  "db_driver": "@saltcorn/mysql-backend",
  "host": "localhost",
  "port": 3306,
  "user": "root",
  "password": "yourpassword",
  "database": "saltcorn_mysql_db",
  "default_schema": "saltcorn_mysql_db"
}

Environment variables (equivalent):

export SALTCORN_DB_DRIVER='@saltcorn/mysql-backend'
export PGHOST='localhost'
export PGPORT='3306'
export PGUSER='root'
export PGPASSWORD='yourpassword'
export PGDATABASE='saltcorn_mysql_db'
export SALTCORN_DEFAULT_SCHEMA='saltcorn_mysql_db'

Or as a single connection URL instead of the discrete host/user/... settings:

export SALTCORN_DB_DRIVER='@saltcorn/mysql-backend'
export DATABASE_URL='mysql://root:yourpassword@localhost:3306/saltcorn_mysql_db'
export SALTCORN_DEFAULT_SCHEMA='saltcorn_mysql_db'

default_schema must equal the database name. MySQL has no separate schema concept, so this driver maps Saltcorn's Postgres-schema-based tenant model to "one MySQL database per tenant", using default_schema as the tenant-less "root" database when no tenant is active.

Connection settings

| Config key | Env var | Meaning | |---|---|---| | db_driver | SALTCORN_DB_DRIVER | Must be @saltcorn/mysql-backend to select this driver. | | host | PGHOST | DB host (the PG prefix is historical - it's read by every driver). | | port | PGPORT | DB port (MySQL default 3306). | | user | PGUSER | DB user. | | password | PGPASSWORD | DB password. | | database | PGDATABASE | Database name. | | default_schema | SALTCORN_DEFAULT_SCHEMA | Root namespace - set equal to database for MySQL. | | connectionString | DATABASE_URL | Full mysql://user:pass@host:port/db URI. Takes priority over the discrete settings above. | | session_secret | SALTCORN_SESSION_SECRET | Session signing secret (optional; a random one is generated with a warning if unset). | | multi_tenant | SALTCORN_MULTI_TENANT | "true" to enable multi-tenancy. | | file_store | SALTCORN_FILE_STORE | Where uploaded files are stored. |

Environment variables are not auto-loaded - source them into your shell before running Saltcorn. When both a DATABASE_URL and discrete settings are present, DATABASE_URL wins.

Usage

Once configured, use the Saltcorn CLI as normal:

saltcorn reset-schema --force        # create system tables + run migrations
saltcorn serve --port 3000           # start the server
saltcorn create-tenant mytenant      # needs SALTCORN_MULTI_TENANT=true

Multi-tenancy

Each tenant is provisioned as its own MySQL database (the analogue of a per-tenant Postgres schema). This needs the connecting user to have CREATE DATABASE / DROP DATABASE privileges.

License

MIT