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

kysely-firebird

v1.1.2

Published

Kysely Dialect and Type Generator for Firebird DB.

Readme

kysely-firebird

Kysely Dialect and Type Generator for Firebird DB. Utilizes node-firebird for database connectivity.

Implementation guided by kysely-oracledb.

Installation

npm install kysely node-firebird kysely-firebird

[!IMPORTANT] This project currently uses node-firebird version 1.2.x, which isn't yet released on npm. Install the library with npm install hgourvest/node-firebird#e1c4dd9 to avoid any issues.

Usage

Firebird DB Dialect

To use the Dialect with Kysely, you must pass in a node-firebird Pool to the FirebirdDialect constructor.

Type-casting to unknown is required to satisfy TypeScript.

// See the section below for more information on generating types.
import type { DB } from "./types.ts";

import Firebird from "node-firebird";
import { Kysely } from "kysely";
import { FirebirdDialect, FirebirdPool } from "kysely-firebird";

const options = {
  host: "host",
  port: 3050,
  database: "/path/to/database.fdb",
  user: "SYSDBA",
  password: "pass",
};

const pool = Firebird.pool(5, options);

const db = new Kysely<DB>({
  dialect: new FirebirdDialect({
    pool: pool as unknown as FirebirdPool,
  }),
});

You can now use the db instance to query your Firebird database.

const users = await db
  .from("USERS")
  .select("ID", "NAME")
  .where("ID", "=", 1)
  .execute();

Dialect Configuration

The dialect can be configured with the following options:

| Option | Type | Description | Required | | -------- | --------------- | ----------------------------------- | -------- | | pool | oracledb.Pool | node-firebird DB connection pool. | Yes | | logger | Logger | Logger instance for debug messages. | No |

Type Generation

Kysely requires you to define the types for your database schema. You can define these manually, or generate them using the generate function:

import Firebird from "node-firebird";
import { generate } from "kysely-firebird";

const options = {
  host: "host",
  port: 3050,
  database: "/path/to/database.fdb",
  user: "SYSDBA",
  password: "pass",
};

const pool = Firebird.pool(5, options);

await generate({
  pool: pool as unknown as FirebirdPool,
  generator: {
    // optional generator options
  },
});

This will generate a types file with the following structure:

import type { Insertable, Selectable, Updateable } from "kysely";

interface UserTable {
  id: number;
  name: string;
}

export type User = Selectable<UserTable>;
export type NewUser = Insertable<UserTable>;
export type UserUpdate = Updateable<UserTable>;

export interface DB {
  user: UserTable;
}

Generator Configuration

The generator can be configured with the same options as the dialect, plus the following options:

| Option | Type | Description | Required | | ------------------ | ------------------------------ | --------------------------------------------------------------- | -------- | | type | "tables" \| "views" \| "all" | Type of generation to perform. | No | | tables | string[] | List of tables to scope type generation. | No | | checkDiff | boolean | Check for differences against existing types before generating. | No | | metadata | boolean | Generate table metadata json file. | No | | filePath | string | File path to write the types to. | No | | metadataFilePath | string | File path to write the metadata (json) to. | No | | prettierOptions | prettier.Options | Prettier options for formatting. | No |