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

@dbx-tools/lakebase

v0.9.190

Published

Node-native Lakebase address parsing, resource discovery, and database credentials

Readme

@dbx-tools/lakebase

Resolve a Databricks Lakebase target into the host, database, and user a PostgreSQL client needs, then request a short-lived database credential. The package gives Node and Bun applications a profile-aware path from a project name or resource URL to connection-ready values. When the target is a Lakebase path or URL without a chosen database, discovery picks the branch default (status.default, then Lakebase's provisioned databricks_postgres) instead of PostgreSQL's generic postgres database.

Quick start

import { LakebaseClient, parseAddress } from "@dbx-tools/lakebase";

const client = new LakebaseClient({ profile: "PROFILE" });
const resolved = await client.resolve(parseAddress("projects/example"));
const password = await client.generateDatabaseCredential(resolved.endpoint);

const connection = {
  host: resolved.host,
  port: resolved.port,
  database: resolved.database,
  user: resolved.user,
  password,
  ssl: { rejectUnauthorized: true },
};

Pass the resolved values to pg, Drizzle, an ORM, or another PostgreSQL client. Request a credential when opening an upstream connection. The client reuses the token until two minutes before the API's expire_time, coalesces concurrent refreshes, and never persists database passwords.

Choose a Lakebase integration

  • Use native AppKit lakebase() for request-aware pools inside a Databricks App.
  • Use @dbx-tools/appkit when Lakebase environment values must be resolved before AppKit plugins initialize.
  • Use this package for profile-aware discovery and credentials in standalone Node or Bun code.
  • Use dbx lakebase-proxy when an external PostgreSQL client needs a local loopback URL.

Choose a target

parseAddress() accepts project IDs, canonical project and branch resources, endpoint or database resources, endpoint hostnames, and PostgreSQL URLs:

parseAddress("my-project");
parseAddress("projects/my-project/branches/production");
parseAddress("ep-example.database.cloud.databricks.com");
parseAddress("postgresql://host/database?sslmode=require");

Use requireAddress() when invalid input should fail immediately. Use parseResourcePath() when the caller must provide a canonical Lakebase resource path rather than any supported address form.

Select authentication

Pass a Databricks profile to LakebaseClient when a local application must use a specific workspace:

const lakebase = new LakebaseClient({ profile: "PROFILE" });

In a Databricks App, ambient app authentication remains available. A startup user supplied to resolve() or generateDatabaseCredential() is treated as a profile only when it exactly matches a configured local profile. An explicit client profile always wins.

Build a proxy URL

connectionUrl() formats the local URL expected by @dbx-tools/cli/lakebase-proxy:

import { connectionUrl } from "@dbx-tools/lakebase";

connectionUrl("projects/my-project", "localhost", 5432);
// postgresql://localhost:5432/projects/my-project?sslmode=disable

API reference

  • address parses supported targets and formats local proxy URLs.
  • client discovers Lakebase resources and creates database credentials.