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

@mygo-plugins/sqlite

v0.2.16

Published

Parameterized SQLite queries and transactions for MyGo desktop apps

Readme

SQLite

SQLite for MyGo, with Go connections and the @mygo-plugins/sqlite TypeScript client. SQLite's C amalgamation and a small C shim are compiled with Zig and loaded through purego. Apps build with CGO_ENABLED=0 and need no Zig, C compiler or Bun at run time.

Register mygo.Use(sqlite.Plugin) only when the web frontend uses @mygo-plugins/sqlite. Go and native UI apps call sqlite.Open directly; they need no plugin registration and close their own connections.

import (
    "github.com/egoist/mygo"
    "github.com/egoist/mygo/plugins/sqlite"
)

func main() {
    mygo.Use(sqlite.Plugin)
    // Create windows, then call mygo.App.Run().
}
import { open } from "@mygo-plugins/sqlite";

const db = await open("app.db");
await db.execute("CREATE TABLE IF NOT EXISTS tasks (id INTEGER PRIMARY KEY, title TEXT, done INTEGER)");
const inserted = await db.execute("INSERT INTO tasks(title, done) VALUES (?, ?)", ["Learn MyGo", false]);
const { columns, rows } = await db.query("SELECT id, title, done FROM tasks WHERE done = ?", [false]);
await db.transaction([
  { sql: "UPDATE tasks SET done = ? WHERE id = ?", params: [true, inserted.lastInsertId] },
  { sql: "INSERT INTO tasks(title, done) VALUES (?, ?)", params: ["Ship the app", false] },
]);
await db.close();

Use bun add @mygo-plugins/sqlite once the npm package is published. In a checkout, bun install && bun run build installs and builds the workspace package. See the full guide for the Go API, types, cancellation, options and packaging.

Building the native libraries

Prebuilt libraries are published in sqlite-3.53.4-1. CI and unpackaged programs download the matching library and verify its SHA-256. Testing and building apps require no Zig installation.

To update SQLite or its C shim, with Zig 0.16.0 on the path:

go generate ./plugins/sqlite
# Or build just this machine, from plugins/sqlite:
go run ./internal/libbuild -target host

The generator downloads SQLite 3.53.4 from sqlite.org and checks its published SHA3-256 before extracting sqlite3.c and sqlite3.h. It builds macOS, Linux and Windows for amd64 and arm64, writes SHA-256 and release URLs to mygo-plugin.json, and populates the CLI's native-library cache. mygo dev and mygo build discover the manifest and bundle the matching library; macOS universal builds combine both architectures. Linux targets glibc 2.28 or later; macOS targets 12 or later. Binaries in build/ are ignored by git.

New binaries must be published before a fresh checkout or app build can download them. The default asset release is sqlite-3.53.4-1:

gh release create sqlite-3.53.4-1 plugins/sqlite/build/* --latest=false \
  --title "SQLite 3.53.4 for MyGo" --notes "SQLite compiled with Zig 0.16.0 and the MyGo C shim."

Change the asset tag (or pass -release <URL>) when the shim, compiler or compile options change; regenerate and publish the manifest and binaries together. -src <directory> uses a local amalgamation instead of the verified download, intended for development.

MYGO_SQLITE_LIBRARY overrides the library path. Otherwise the plugin looks in app resources, next to the executable, then the CLI's cache. Unpackaged programs download a missing library and verify its SHA-256; packaged apps never download native code at run time.

SQLite is public domain; the plugin and C shim use the repository's MIT license. FTS5, RTree and JSON are enabled, with foreign keys on by default. Loadable extensions, shared cache and deprecated APIs are omitted.