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

@sqlsmith/vite-plugin

v0.6.1

Published

Vite plugin for SQLsmith - automatic SQL schema merging during development

Downloads

176

Readme

@sqlsmith/vite-plugin

Vite plugin for SQLsmith - automatic SQL schema merging during development.

Installation

npm install -D @sqlsmith/vite-plugin

Supports Vite 4, 5, and 6; the integration suite runs against Vite 6.4.3.

Usage

// vite.config.ts
import { defineConfig } from 'vite'
import { sqlsmith } from '@sqlsmith/vite-plugin'

export default defineConfig({
  plugins: [
    sqlsmith({
      input: './src/schemas',     // Directory with SQL files
      output: './src/schema.sql', // Output merged file
      dialect: 'postgresql',      // Optional: SQL dialect
      defaultSchema: 'public',    // Optional: unqualified relation schema
      logLevel: 'info'            // silent | error | warn | info | debug
    })
  ]
})

Options

  • input (required): Directory containing SQL files
  • output (required): Output file path for merged schema
  • dialect (optional): SQL dialect from core's SUPPORTED_DIALECTS registry (default: postgresql)
  • defaultSchema (optional): Schema assigned to unqualified relation names (PostgreSQL default: public)
  • watch (optional): Enable file watching (default: auto-detected based on dev/build mode)
  • logLevel (optional): Shared SQLsmith log level: silent, error, warn, info, or debug (default: info)
  • allowExternalReferences (optional): Keep references to relations outside the input and emit diagnostics instead of failing

silent suppresses SQLsmith logs only; schema generation and Vite error reporting remain active. The former normal/verbose aliases were removed in favor of the shared core levels.

Debug output and warning deduplication

At logLevel: 'debug' every generation additionally reports the discovered SQL files, the dependency graph and the recommended execution order — the same renderers the CLI info command uses.

At warn and info, diagnostics (external references, raw passthrough statements, cross-file raw references) are deduplicated across watch rebuilds:

  • the first build prints every diagnostic in full;
  • subsequent rebuilds print only new or changed diagnostics and collapse the rest into a single line: SQLsmith: N known warning(s) — set logLevel: 'debug' to see all;
  • a diagnostic that disappears and later returns is printed in full again;
  • a failed rebuild keeps the known set of the last successful generation, matching the preserved last-good output;
  • debug disables deduplication and always prints everything.

The known set lives in plugin memory, so restarting the dev server prints all diagnostics in full again.

Runtime SET search_path statements are preserved but are not interpreted by dependency analysis; configure defaultSchema to match the effective schema.

Discovery and watch lifecycle

  • Discovery is recursive and uses the same MergePlan pipeline as core.
  • The input root and every discovered SQL file are registered with Vite.
  • Create, update, and delete events trigger one full rediscovery and generation.
  • A generated output inside the input directory is excluded from discovery and watching, preventing self-merge loops.
  • Output is written atomically. Invalid SQL leaves the last valid output unchanged; production builds fail, while development reports through Vite.

Features

  • File watching - Recursive regeneration on create, update, and delete
  • Build integration - Schema validation during build process
  • Atomic output - Invalid updates preserve the last valid schema
  • Error handling - Build failures propagate; dev failures use Vite reporting
  • Zero config - Works out of the box with sensible defaults

License

MIT