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

@venturekit/data

v0.0.0-dev.20260507015944

Published

Database and data layer for VentureKit

Readme

@venturekit/data

Warning: This package is in active development and not production-ready. APIs may change without notice.

Database and data layer for VentureKit — RDS configuration, migrations, query utilities, and transactions.

Installation

npm install @venturekit/data@dev

Overview

@venturekit/data provides:

  • RDS configurationcreateRdsConfig(), buildRdsConfig() for PostgreSQL and MySQL
  • Migration utilitiescreateMigrationConfig(), Flyway environment helpers
  • Query utilitiesquery(), getPool(), mapResults(), mapRow()
  • Transaction supportbeginTransaction(), withTransaction(), buildTransaction()

Query Utilities

import { query, getPool, mapResults } from '@venturekit/data';

// Simple query
const result = await query('SELECT * FROM tasks WHERE id = $1', [taskId]);

// Get the connection pool
const pool = getPool();

// Map results with a custom mapper
const tasks = mapResults(result, row => ({
  id: row.id,
  title: row.title,
  completed: row.completed,
}));

Transactions

import { withTransaction, beginTransaction } from '@venturekit/data';

// Automatic commit/rollback
const result = await withTransaction(async (tx) => {
  await tx.query('INSERT INTO tasks (title) VALUES ($1)', ['New task']);
  await tx.query('UPDATE counters SET count = count + 1 WHERE name = $1', ['tasks']);
  return { created: true };
});

// Manual transaction control
const tx = await beginTransaction();
try {
  await tx.query('INSERT INTO tasks (title) VALUES ($1)', ['New task']);
  await tx.commit();
} catch (error) {
  await tx.rollback();
  throw error;
}

Transactional Handlers

When used with @venturekit/runtime, enable automatic transactions per request:

import { handler } from '@venturekit/runtime';

export const main = handler(async (body, ctx, logger) => {
  // ctx.tx is available — auto-commits on success, rolls back on error
  await ctx.tx.query('INSERT INTO tasks (title) VALUES ($1)', [body.title]);
  return { created: true };
}, { scopes: ['tasks.write'], transactional: true });

RDS Configuration

import { createRdsConfig, DEFAULT_RDS_CONFIG } from '@venturekit/data';

const rdsConfig = createRdsConfig({
  engine: 'postgres',
  instanceSize: 'small',
  databaseName: 'mydb',
});

Migrations

@venturekit/data ships a pure-SQL migration runner. Drop .sql files into db/migrations/ and apply them with the CLI:

vk migrate            # Apply pending schema migrations
vk migrate --seed     # Apply migrations, then seeds from db/seeds/
vk migrate status     # Show which migrations and seeds have been applied

Applied files are tracked in __vk_migrations / __vk_seeds. The file-content hash is locked once recorded — editing an applied file hard-fails on the next run; write a new migration instead.

API Reference

See the API reference for full documentation.

License

Apache-2.0 — see LICENSE for details.