open-index/open-npm huggingface dataset:
npm package: @sqlm/sqlm
Description: Sqlm is an SQLite wrapper to manage databases for mobile: inspirate by Realm
Author: yvan-botella
Latest version: 0.0.2

# WORK IN PROGRESS

# Getting Started

## Introduction

Sqlm is an SQLite wrapper to manage databases for mobile: inspirate by Realm

## Installation

- npm:
  `npm - @sqlm/sqlm`

- yarn: `yarn add @sqlm/sqlm`

No linking requiered since there is no native modules.

# Sqlm

## Models

Sqlm use models statics to define table, column properties can be defined by `SqlmType` (wich looks like PropTypes).

```js
import SqlmTypes from "Sqlm-types";

class User {
  get fullname() {
    return `${this.firstname} ${this.lastname}`;
  }
}

User.name = "User";
User.version = 1;
User.properties = {
  id: SqlmTypes.string.isPrimary,
  lastname: SqlmTypes.string,
  firstname: SqlmTypes.string,
  birthday: SqlmTypes.date
};

export default User;
```

## Opening Database

Opening an Sqlite Database through Sqlm is done by calling the static open method on the Sqlm class with associated configuration object.

```js
import Sqlm, { setSQLite } from "sqlm";
import { SQLite } from "expo";
import User from "./User";

setSQLite(SQLite); // Set which SQLite to use, it's could come from 'expo', 'expo-sqlite'.

const config = {
  path: "db.sqlite", // Optional: Path and name of the DB.
  models: [User] // Required available models for this instance.
};

Sqlm.open(config)
  .then(sqlm => {
    // ...have fun with your sqlm instance
  })
  .catch(error => {
    // ...handle error as you wish
  });
```

## Writes

### Creating

```js
import User from "./User";

const update = true; // Optional: will update data, or throw an error if already exist.
const users = {
  id: "1",
  lastname: "Team",
  firstname: "Sqlm",
  birthday: new Date("2019-01-01")
};

sqlm.create(User, user, update);
```

## Queries

### Object queries

```js
const users = sqlm
  .from(User)
  .where()
  .column("lastname")
  .beginWith("T")
  .and.column("birthdate")
  .before(Date.now())
  .limit(1)
  .getAll();

// getAll will give the whole result
// but it's will be replace with proxy, then iterator could access it lazy
```

### Raw queries

Alternatively, you can still use raw query for **SQlite**, but used at your own risk, result won't be managed by **Sqlm**.

```js
const query = "SELECT * FROM User";
const ResultSet = sqlm.executeQuery(query);
```

## Features

### KeyExtractor

List like Flatlist use **keyExtractor** to extract a unique key for a given item at the specified index. Key is used for caching and as the react key to track item re-ordering. The default extractor checks `item.key`, then falls back to using the index, like React does.

To make things easier, Sqlm can handle it for you by adding a `.key` to each items queried.

```js
const enabled = true;
Sqlm.useKeyExtractor(enabled);
```

Alternatively, you can provide a custom keyExtractor.

```js
const keyExtractor = (item, model, table) => {
  // ...return the string to use by keyExtractor
};
Sqlm.setKeyExtractor(keyExtractor);
```

⚠️ `useKeyExtractor` & `setKeyExtractor` are overriding each other.
npm package: @sqlml/ui
Description: SQLML Web UI - Visual database management interface
Author: Ruffiano
Latest version: 0.3.8

<p align="center">
  <h1 align="center">@sqlml/ui</h1>
  <p align="center">Web-based database management GUI for SQLML</p>
</p>

<p align="center">
  <a href="https://www.npmjs.com/package/@sqlml/ui"><img src="https://img.shields.io/npm/v/@sqlml/ui.svg" alt="npm version"></a>
  <a href="https://www.npmjs.com/package/@sqlml/ui"><img src="https://img.shields.io/npm/dm/@sqlml/ui.svg" alt="npm downloads"></a>
  <a href="https://github.com/Ruffiano/sqlml/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@sqlml/ui.svg" alt="license"></a>
  <a href="https://github.com/Ruffiano/sqlml"><img src="https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg" alt="node version"></a>
</p>

---

A visual interface for managing database schemas, migrations, connections, and data — built with NestJS + React. Part of the [@sqlml/cli](https://www.npmjs.com/package/@sqlml/cli) toolkit.

## Quick Start

The easiest way to use `@sqlml/ui` is through the CLI:

```bash
npm install -g @sqlml/cli
sqlml ui
```

Opens at **http://localhost:4200**. Press `Ctrl+C` to stop.

## Screenshots & Features

### Dashboard

Project overview with ORM type indicator (TypeORM/Prisma), quick stats, and an organized command reference for the CLI.

### Schema Editor

Full DBML schema editing powered by Monaco Editor (the same editor behind VS Code). Create, edit, and manage multiple `.dbml` schema files with syntax highlighting.

### Schema Diff

Visual side-by-side comparison between schema snapshots. Auto-loads the latest vs previous snapshot. Color-coded additions, deletions, and changes.

### Migrations

View all migration files and their status (pending, applied, reverted). Run and revert migrations directly from the UI. Manage migration templates.

### Database

All-in-one database management page:

| Feature | Description |
|---------|-------------|
| **Connection Manager** | Add, edit, test, and delete database connections. Auto-creates from `.config-sqlml` |
| **Schema Browser** | Expandable tree of schemas and tables with column details, types, primary keys, and row estimates |
| **Data Grid** | Paginated table viewer with column sorting. Double-click to edit cells inline. Add and delete rows |
| **Query Editor** | Write and execute SQL queries with Cmd/Ctrl+Enter. Results in a scrollable grid. Schema-aware search path |

### Settings

Edit database connection, generation options, file paths, and other configuration — all persisted to `.config-sqlml`.
```
  UI_PORT=4200
  UI_THEME=dark
  UI_OPEN_BROWSER=true
```

## Links

- [GitHub Repository](https://github.com/Ruffiano/sqlml)
- [Report Issues](https://github.com/Ruffiano/sqlml/issues)
- [@sqlml/cli on npm](https://www.npmjs.com/package/@sqlml/cli)

## License

MIT
npm package: @sqlpm/enum-ts
Description: ``@sqlpm/file-async-ts` is a typescript library applying the facade pattern to asynchronous file access.
Author: Eric Hosick
Latest version: 1.0.3

# `@sqlpm/enum-ts`

A utility project that has helper functions for verifying and displaying
typescript enums.

## Usage

### isValidEnumValue

Checks if a value is a valid member of an enumeration.

@template T - The type of the enumeration.
@param {T} enumObj - The enumeration object.
@param {unknown} value - The value to check.
@returns {value is T[keyof T]} - A boolean indicating whether the value is a
valid member of the enumeration.

@example

```typescript
enum TestEnum {
  One = 'one',
  Two = 'two',
  Three = 'three',
}

if (isValidEnumValue(TestEnum, TestEnum.One)) {
  // The value 'one' is a valid member of the TestEnum enum.
  // Do something...
} else {
  // The value 'one' is not a valid member of the TestEnum enum.
  // Do something else...
}
```

### enumToString

Converts an enumeration to an array of strings.
@template T - The type of the enumeration.
@param {T} enumObj - The enumeration object.
@returns {string} - A comma separated string of the enumeration values.
@example

```typescript
enum TestEnum {
 One = 'one',
 Two = 'two',
 Three = 'three',
}
const testEnumArray = enumToStringArray(TestEnum);
// testEnumArray = 'one,two,three'
```
npm package: @sqlpm/iso-postgresql
Description: contains iso data for languages, countries, etc. Date comes from places like https://datahub.io/collections/reference-data.
Author: Eric Hosick
Latest version: 1.2.3

# **iso-postgresql**

contains iso data for languages, countries, etc. Date comes from places like <https://datahub.io/collections/reference-data>.

## Introduction

This package contains re-usable [Postgresql](https://www.postgresql.org/) sql ddl. The package is installed using a traditional node package manager such as [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/). Applying the sql located in the package to a Postgresql database instance can be done by using [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) or a migration tool of your choosing.

This package has:

* **definitions** - Sql is stored within the package.
* **Testing, BDD/TDD** - Testing is done using the [jest](https://jestjs.io/) testing framework but the tests are written in Sql. True behavior driven development is supported via `yarn test:postgresql:watch`.
* **versioned** - Versioning is used and supported via [lerna](https://lerna.js.org/).
* **dependencies** - The dependency features of the javascript package manager are leveraged. [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) projects can depend on other projects.

## Usage

// TODO

## Generated

This package was generated form the root of this repository as follows:

```bash
yarn sqlpm generate '{"packageName": "iso", "databaseSystem": "postgresql", "description": "contains iso data for languages, countries, etc. Date comes from places like https://datahub.io/collections/reference-data.", "author": "...", "email": "...", "purposes": ["readwrite"], "actions": ["run", "test", "reset"]}'

yarn lerna add @sqlpm/sqlpm-lib-ts --scope=@sqlpm/iso-postgresql

# Add the universal schema dependency
yarn lerna add @sqlpm/universal-postgresql --scope=@sqlpm/iso-postgresql
```
npm package: @sqlpm/logging-postgresql
Description: contains features around logging, notifications, and notices.
Author: Eric Hosick
Latest version: 1.3.3

# **logging-postgresql**

contains features around logging, notifications, and notices.

## Introduction

This package contains re-usable [Postgresql](https://www.postgresql.org/) sql ddl. The package is installed using a traditional node package manager such as [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/). Applying the sql located in the package to a Postgresql database instance can be done by using [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) or a migration tool of your choosing.

This package has:

* **definitions** - Sql is stored within the package.
* **Testing, BDD/TDD** - Testing is done using the [jest](https://jestjs.io/) testing framework but the tests are written in Sql. True behavior driven development is supported via `yarn test:postgresql:watch`.
* **versioned** - Versioning is used and supported via [lerna](https://lerna.js.org/).
* **dependencies** - The dependency features of the javascript package manager are leveraged. [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) projects can depend on other projects.

## Usage

// TODO

## Generated

This package was generated form the root of this repository as follows:

```bash
yarn sqlpm generate '{"packageName": "logging", "databaseSystem": "postgresql", "description": "contains features around logging, notifications, and notices.", "author": "...", "email": "...", "purposes": ["readwrite"], "actions": ["run", "test", "reset"]}'

yarn lerna add @sqlpm/sqlpm-lib-ts --scope=@sqlpm/logging-postgresql

# Add the universal schema dependency
yarn lerna add @sqlpm/universal-postgresql --scope=@sqlpm/logging-postgresql

# Add the tag schema dependency
yarn lerna add @sqlpm/tag-postgresql --scope=@sqlpm/logging-postgresql

# Add the tag schema dependency
yarn lerna add @sqlpm/persona-postgresql --scope=@sqlpm/logging-postgresql
```
npm package: @sqlpm/persona-postgresql
Description: support users, persona entities, companies, etc.
Author: Eric Hosick
Latest version: 1.2.3

# **persona-postgresql**

support users, persona entities, companies, etc.

## Introduction

This package contains re-usable [Postgresql](https://www.postgresql.org/) sql ddl. The package is installed using a traditional node package manager such as [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/). Applying the sql located in the package to a Postgresql database instance can be done by using [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) or a migration tool of your choosing.

This package has:

* **definitions** - Sql is stored within the package.
* **Testing, BDD/TDD** - Testing is done using the [jest](https://jestjs.io/) testing framework but the tests are written in Sql. True behavior driven development is supported via `yarn test:postgresql:watch`.
* **versioned** - Versioning is used and supported via [lerna](https://lerna.js.org/).
* **dependencies** - The dependency features of the javascript package manager are leveraged. [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) projects can depend on other projects.

## Usage

// TODO

## Generated

This package was generated form the root of this repository as follows:

```bash
yarn sqlpm generate '{"packageName": "persona", "databaseSystem": "postgresql", "description": "support users, persona entities, companies, etc.", "author": "Eric Hosick", "email": "erichosick@gmail.com", "purposes": ["readwrite"], "actions": ["run", "test", "reset"]}'

yarn lerna add @sqlpm/sqlpm-lib-ts --scope=@sqlpm/persona-postgresql

# Add the universal schema dependency
yarn lerna add @sqlpm/universal-postgresql --scope=@sqlpm/persona-postgresql

# Add the tag schema dependency
yarn lerna add @sqlpm/tag-postgresql --scope=@sqlpm/persona-postgresql
```
npm package: @sqlpm/postgresql-client-ts
Description: `@sqlpm/postgresql-client-ts` is a typescript library that wraps the porsager/postgres library.
Author: Eric Hosick
Latest version: 1.5.3

# `@sqlpm/postgresql-client-ts`

> TODO: description

## Usage

```
const postgresqlClientTs = require('@sqlpm/postgresql-client-ts');

// TODO: DEMONSTRATE API
```
npm package: @sqlpm/settings-postgresql
Description: contains helper functions for using PostgreSQL configuration settings
Author: Eric Hosick
Latest version: 0.1.3

# **settings-postgresql**

contains helper functions for using PostgreSQL configuration settings

## Introduction

This package contains re-usable [Postgresql](https://www.postgresql.org/) sql ddl. The package is installed using a traditional node package manager such as [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/). Applying the sql located in the package to a Postgresql database instance can be done by using [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) or a migration tool of your choosing.

This package has:

* **definitions** - Sql is stored within the package.
* **Testing, BDD/TDD** - Testing is done using the [jest](https://jestjs.io/) testing framework but the tests are written in Sql. True behavior driven development is supported via `yarn test:postgresql:watch`.
* **versioned** - Versioning is used and supported via [lerna](https://lerna.js.org/).
* **dependencies** - The dependency features of the javascript package manager are leveraged. [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) projects can depend on other projects.

## Usage

// TODO

## Generated

This package was generated using [@sqlpm/package-generator-ts](https://www.npmjs.com/package/@sqlpm/package-generator-ts).
npm package: @sqlpm/sqlpm-example-postgresql
Description: Used to test the sqlpm along with .
Author: Eric Hosick
Latest version: 1.2.1

# **sqlpm-example-postgresql**

Used to test the sqlpm along with .

## Usage

## Generated

This package was generated [@sqlpm/package-generator-ts](https://www.npmjs.com/package/@sqlpm/package-generator-ts) as follows:

```typescript
import {
  DatabaseSystem,
  DatabaseAccessMode,
} from '@sqlpm/types-ts';

import {
  schemaProjectInit,
} from '@sqlpm/package-generator-ts';

(async () => {
  await schemaProjectInit(
    'sqlpm-example',
    DatabaseSystem.Postgresql,

    'Used to test the sqlpm along with .',
    'Eric Hosick',
    'erichosick@gmail.com',
    [DatabaseAccessMode.ReadWrite, DatabaseAccessMode.ReadOnly],
  );
})();

```
npm package: @sqlpm/tag-postgresql
Description: support tagging including domains and hierarchical tags via ltree (https://www.postgresql.org/docs/14/ltree.html).
Author: Eric Hosick
Latest version: 1.2.3

# **tag-postgresql**

support tagging including domains and hierarchical tags via ltree (<https://www.postgresql.org/docs/14/ltree.html>).

## Introduction

This package contains re-usable [Postgresql](https://www.postgresql.org/) sql ddl. The package is installed using a traditional node package manager such as [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/). Applying the sql located in the package to a Postgresql database instance can be done by using [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) or a migration tool of your choosing.

This package has:

* **definitions** - Sql is stored within the package.
* **Testing, BDD/TDD** - Testing is done using the [jest](https://jestjs.io/) testing framework but the tests are written in Sql. True behavior driven development is supported via `yarn test:postgresql:watch`.
* **versioned** - Versioning is used and supported via [lerna](https://lerna.js.org/).
* **dependencies** - The dependency features of the javascript package manager are leveraged. [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) projects can depend on other projects.

## Usage

// TODO

## Generated

This package was generated form the root of this repository as follows:

```bash
yarn sqlpm generate '{"packageName": "tag", "databaseSystem": "postgresql", "description": "support tagging including domains and hierarchical tags via ltree (https://www.postgresql.org/docs/14/ltree.html).", "author": "...", "email": "...", "purposes": ["readwrite"], "actions": ["run", "test", "reset"]}'

yarn lerna add @sqlpm/sqlpm-lib-ts --scope=@sqlpm/tag-postgresql

# Add the universal schema dependency
yarn lerna add @sqlpm/universal-postgresql --scope=@sqlpm/tag-postgresql

# Add the iso schema dependency
yarn lerna add @sqlpm/iso-postgresql --scope=@sqlpm/tag-postgresql
```
npm package: @sqlpm/test-postgresql
Description: Contains resources that can be used for testing.
Author: Eric Hosick
Latest version: 1.5.3

# **test-postgresql**

Contains resources for testing. This [Sqlpm](https://github.com/erichosick/sqlpm) package is used by other Sqlpm for running tests within Sql.

## Introduction

This package contains re-usable [Postgresql](https://www.postgresql.org/) sql. The package is installed using a traditional javascript package manager such as [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/). Applying the sql located in the package to a Postgresql database instance can be done by using [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) or a migration tool of your choosing.

This package has:

* **definitions** - Sql is stored within the package.
* **Testing, BDD/TDD** - Testing is done using the [jest](https://jestjs.io/) testing framework but the tests are written in Sql. True behavior driven development is supported via `yarn test:postgresql:watch`.
* **versioned** - Versioning is used and supported via [lerna](https://lerna.js.org/).
* **dependencies** - The dependency features of the javascript package manager are leveraged. [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) projects can depend on other projects.

## Usage

// TODO

## Generated

This package was generated form the root of this repository as follows:

```bash
yarn sqlpm generate '{"packageName": "test", "databaseSystem": "postgresql", "description": "Contains resources that can be used for testing.", "author": "...", "email": "...", "purposes": ["readwrite"], "actions": ["run", "test", "reset"]}'

yarn lerna add @sqlpm/sqlpm-lib-ts --scope=@sqlpm/test-postgresql
```
npm package: @sqlpm/universal-postgresql
Description: ## Usage
Author: Eric Hosick
Latest version: 1.2.3

# **universal-postgresql**

## Usage

## Introduction

This package contains re-usable [Postgresql](https://www.postgresql.org/) sql. The package is installed using a traditional javascript package manager such as [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/). Applying the sql located in the package to a Postgresql database instance can be done by using [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) or a migration tool of your choosing.

This package has:

* **definitions** - Sql is stored within the package.
* **Testing, BDD/TDD** - Testing is done using the [jest](https://jestjs.io/) testing framework but the tests are written in Sql. True behavior driven development is supported via `yarn test:postgresql:watch`.
* **versioned** - Versioning is used and supported via [lerna](https://lerna.js.org/).
* **dependencies** - The dependency features of the javascript package manager are leveraged. [Sql Package Manager](https://github.com/erichosick/sqlpm/tree/main/packages/sqlpm) projects can depend on other projects.

## Usage

// TODO

## Generated

This package was generated form the root of this repository as follows:

```bash
yarn sqlpm generate '{"packageName": "universal", "databaseSystem": "postgresql", "description": "Contains resources that can be used for testing.", "author": "...", "email": "...", "purposes": ["readwrite"], "actions": ["run", "test", "reset"]}'

yarn lerna add @sqlpm/sqlpm-lib-ts --scope=@sqlpm/universal-postgresql

# Add the test schema dependency
yarn lerna add @sqlpm/test-postgresql --scope=@sqlpm/universal-postgresql

# Add the library schema dependency
yarn lerna add @sqlpm/lib-postgresql --scope=@sqlpm/universal-postgresql
```
npm package: @sqlrooms/cells
Description: Shared cells model and UI primitives used by notebook and canvas views.
Author: SQLRooms Contributors
Latest version: 0.29.0-rc.1

# @sqlrooms/cells

Shared cells model and UI primitives used by notebook and canvas views.

The package owns:

- canonical cell records (`cells.config.data`)
- sheet grouping and ordering (`cells.config.sheets`, `sheetOrder`, `currentSheetId`)
- in-sheet dependency edges and cascade execution
- SQL/result execution helpers and status tracking

## Dependency and schema model

- Dependencies and cascades are **sheet-local** by default.
- Cross-sheet references are only supported via explicit fully qualified SQL names.
- SQL execution resolves to a stable sheet schema namespace; it does not rely on global `USE schema`.
- Unqualified result-name references are resolved to the current sheet namespace during execution.

## Stable public API

Import from package root for stable APIs:

- slice: `createCellsSlice`
- hooks: `useCellsStore`
- helpers: `findSheetIdForCell`, `getSheetsByType`
- SQL helpers: `renderSqlWithInputs`, `findSqlDependencies`, `findSqlDependenciesFromAst`
- UI: `SqlCellContent`, `SqlCellRunButton`, `TextCellContent`, `InputCellContent`, `VegaCellContent`, `SheetsTabBar`
- types/schemas: exports from `types.ts`

## Internal APIs

Avoid importing internal implementation modules directly (for example `dagUtils`, `execution`, or component subpaths). These are not guaranteed to be semver-stable.
npm package: @sqlrooms/db
Description: DuckDB-centered orchestration layer for SQLRooms multi-database execution.
Author: SQLRooms Contributors
Latest version: 0.29.0-rc.1

DuckDB-centered orchestration layer for SQLRooms multi-database execution.

## Purpose

- Keep DuckDB as the core runtime for SQL execution DAG semantics.
- Register and route connector execution for external engines.
- Aggregate connector catalogs/schemas into one explorer view.
- Materialize non-DuckDB results into core DuckDB with a configurable policy.

## Notes

- This package is intentionally additive and keeps `@sqlrooms/duckdb` APIs intact.
- Default materialization strategy is strict ephemeral attached database mode.
npm package: @sqlrooms/duckdb-config
Description: A central configuration and type definitions package that maintains base DuckDB configuration schemas and Zod schema definitions for SQLRooms. It provides TypeScript types and interfaces along with essential constants and utilities used for managing DuckD
Author: Ilya Boyandin
Latest version: 0.26.0-rc.4

A central configuration and type definitions package that maintains base DuckDB configuration schemas and Zod schema definitions for SQLRooms. It provides TypeScript types and interfaces along with essential constants and utilities used for managing DuckDB state.

## Features

- 📝 **DuckDB Configuration**: Define and manage room DuckDB configuration schemas.
- 🔍 **Type Safety**: Strong TypeScript typing for DuckDB configuration objects.
- ✅ **Validation**: Zod schemas for runtime validation of DuckDB configurations.

## Installation

```bash
npm install @sqlrooms/duckdb-config
# or
yarn add @sqlrooms/duckdb-config
```

## Basic Usage

### Working with DuckDB Configuration

```tsx
import {
  DuckDbSliceConfig,
  createDefaultDuckDbConfig,
} from '@sqlrooms/duckdb-config';

// Create a new DuckDB configuration
const duckDbConfig: DuckDbSliceConfig = createDefaultDuckDbConfig();

// This is then used as part of a bigger room configuration.
// The `RoomConfig` for a room is typically a composition of slice configurations.
// For example:
//
// import {SqlEditorSliceConfig} from '@sqlrooms/sql-editor-config';
//
// type RoomConfig = DuckDbSliceConfig & SqlEditorSliceConfig;
```

## Advanced Features

- **Schema Extensions**: Extend base schemas for custom room types
- **Configuration Validation**: Validate configurations at runtime
- **Serialization**: Convert configurations to/from JSON for storage

For more information, visit the SQLRooms documentation.

```

```
npm package: @sqlrooms/notebook
Description: Tabbed notebook UI and Zustand slice for SQL/text/markdown/vega/input cells in SQLRooms apps.
Author: SQLRooms Contributors
Latest version: 0.29.0-rc.1

# @sqlrooms/notebook

Tabbed notebook UI and Zustand slice for SQL/text/markdown/vega/input cells in SQLRooms apps.

- NotebookSlice stores tabs and cells under `config.notebook`
- SQL cells create DuckDB views in schema `notebook` using the cell name
- Cell execution cascades to dependents when definitions change
- Pluggable cell renderers supported via `createNotebookSlice()`

## Installation

```bash
pnpm add @sqlrooms/notebook
```

## API

### Config

- `createDefaultNotebookConfig(partial?)` → default `config.notebook`
- Zod schemas: `NotebookSliceConfig`, `NotebookCellSchema`, `NotebookTabSchema`

### Slice

```ts
createNotebookSlice({});
```

Requires a store that also includes `@sqlrooms/duckdb` slice for `db.sqlSelectToJson` and `db.getConnector`.

Notebook actions under `notebook`:

- `addTab()`, `renameTab(id, title)`, `setCurrentTab(id)`, `removeTab(id)`
- `addCell(tabId, type)`, `removeCell(cellId)`, `renameCell(cellId, name)`, `updateCell(cellId, updater)`
- `runCell(cellId, opts?)`, `runAllCells(tabId)`, `cancelRunCell(cellId)`

SQL cells must contain a single `SELECT` statement. Validation is performed via `get().db.sqlSelectToJson(lastQueryStatement)`. Successful execution creates or replaces a DuckDB view in schema `notebook` named after the cell.

Dependencies are inferred from `sqlSelectToJson` and basic name references; when a cell runs, dependent SQL cells are re-run unless `cascade` is disabled.

### UI

`createNotebookComponents(useStore)` returns `{ Notebook }` React component bound to your store hook.

```tsx
const {Notebook} = createNotebookComponents(useRoomStore);
<Notebook />;
```

Tabs use `EditableText` for renaming, with a + Add button. SQL, Text, Markdown, Vega (stub), and Input cells are supported out of the box.

## Stable vs internal imports

Use root imports from `@sqlrooms/notebook` as the stable API surface.

- stable: `createNotebookSlice`, `createDefaultNotebookConfig`, `Notebook`, `useStoreWithNotebook`, exported schema types
- internal: direct imports from implementation files under `src/` are not semver-stable and may change without notice
npm package: @sqlsmith/cli
Description: CLI for SQLsmith - SQL schema merging with dependency resolution
Author: Pavel Nedrigailov
Latest version: 0.4.2

# @sqlsmith/cli

Command-line interface for SQLsmith - SQL schema merging with dependency resolution.

## Installation

```bash
# Global installation
npm install -g @sqlsmith/cli

# Or use with npx
npx @sqlsmith/cli
```

## Usage

```bash
# Merge SQL files (to stdout by default)
sqlsmith ./schemas --output merged.sql

# Analyze dependencies
sqlsmith info ./schemas

# Validate files
sqlsmith validate ./schemas
```

## Commands

### Merge (default)
```bash
sqlsmith <input-directory> [options]
```

### Info
```bash
sqlsmith info <input-directory> [options]
```

### Validate  
```bash
sqlsmith validate <input-directory> [options]
```

## Options

- `-o, --output <path>` - Output file path (default: stdout)
- `-d, --dialect <dialect>` - SQL dialect: postgresql, mysql, sqlite, bigquery
- `--allow-reorder-drop-comments` - Allow reordering statements within files (drops comments)
- `--log-level <level>` - Set log level: error, warn, info, debug (default: info)

## Log Levels

The `--log-level` option controls the verbosity of console output:

- `error` - Only show error messages
- `warn` - Show error and warning messages  
- `info` - Show error, warning, and info messages (default)
- `debug` - Show all messages including debug information

## Examples

```bash
# Merge SQL files to stdout with default settings
sqlsmith ./schemas

# Merge to a specific output file
sqlsmith ./schemas --output merged.sql

# Merge with minimal console output
sqlsmith ./schemas --log-level error --output merged.sql

# Analyze dependencies with debug information
sqlsmith info ./schemas --log-level debug

# Validate with only warnings and errors
sqlsmith validate ./schemas --log-level warn

# Use different SQL dialect
sqlsmith ./schemas --dialect mysql --output merged.sql
```

## License

MIT
npm package: @sqlsmith/core
Description: Core SQL schema merging engine with dependency resolution
Author: Pavel Nedrigailov
Latest version: 0.4.2

# @sqlsmith/core

Core SQL schema merging engine with dependency resolution.

## Installation

```bash
npm install @sqlsmith/core
```

## Usage

```typescript
import { SqlMerger } from '@sqlsmith/core';

const merger = new SqlMerger();

// Parse SQL files from directory
const sqlFiles = merger.parseSqlFiles('./schemas', 'postgresql');

// Merge files with options
const merged = merger.mergeFiles(sqlFiles, {
  addComments: true,
  includeHeader: true,
  separateStatements: true,
  outputPath: 'merged.sql' // Optional: write to file
});

console.log(merged); // Merged SQL content
```

## Features

- ✅ **Smart dependency detection** - Analyzes FOREIGN KEY constraints
- ✅ **Topological sorting** - Safe execution order using Kahn's algorithm
- ✅ **Circular dependency detection** - Prevents invalid schemas
- ✅ **Multi-dialect support** - PostgreSQL, MySQL, SQLite, BigQuery
- ✅ **Sequences & Views** - Handles CREATE SEQUENCE and CREATE VIEW statements
- ✅ **TypeScript support** - Full type safety and IntelliSense

## API

### SqlMerger

Main class for SQL merging operations.

### Processors

- `CreateTableProcessor` - Handles CREATE TABLE statements
- `CreateSequenceProcessor` - Handles CREATE SEQUENCE statements  
- `CreateViewProcessor` - Handles CREATE VIEW statements

#### Processor interface

```ts
import type { AST } from 'node-sql-parser'
import type { SqlStatement } from './types/sql-statement'

export interface StatementProcessor {
  getHandledTypes(): string[]
  canProcess(statement: AST): boolean
  extractStatements(ast: AST | AST[], filePath: string): SqlStatement[]
}
```

Note: pre-release change — the `extractStatements` method no longer receives a `dialect` parameter. If you need dialect-specific behavior in a custom processor, pass it via the constructor or configuration when creating the processor.

### Services

- `DependencyAnalyzer` - Analyzes statement dependencies
- `TopologicalSorter` - Sorts statements by dependencies
- `SqlFileParser` - Parses SQL files and extracts statements

## License

MIT
npm package: @sqlsmith/vite-plugin
Description: Vite plugin for SQLsmith - automatic SQL schema merging during development
Author: Pavel Nedrigailov
Latest version: 0.4.2

# @sqlsmith/vite-plugin

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

## Installation

```bash
npm install -D @sqlsmith/vite-plugin
```

## Usage

```typescript
// 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
    })
  ]
})
```

## Options

- `input` (required): Directory containing SQL files
- `output` (required): Output file path for merged schema
- `dialect` (optional): SQL dialect - `postgresql`, `mysql`, `sqlite`, `bigquery` (default: `postgresql`)
- `watch` (optional): Enable file watching (default: auto-detected based on dev/build mode)

## Features

- ✅ **File watching** - Automatic regeneration when SQL files change
- ✅ **Build integration** - Schema validation during build process  
- ✅ **Error handling** - Non-blocking errors in dev mode
- ✅ **Zero config** - Works out of the box with sensible defaults

## License

MIT
npm package: @sqltags/mysql
Description: MySQL driver for sqltags (@sqltags/core) 🔧✨ Safely create & execute parameterized SQL queries using template strings
Author: Alex Brombal
Latest version: 0.1.0

# <img src="https://raw.githubusercontent.com/brombal/sqltags/v1/sqltags-logo.svg" width="400" alt="sqltags project logo" title="sqltags" />

![Build status](https://github.com/brombal/sqltags/actions/workflows/build-test.yml/badge.svg?branch=main)
[![npm version](https://badge.fury.io/js/@sqltags%2Fcore.svg)](https://badge.fury.io/js/@sqltags/mysql)

<br>

## SqlTags MySQL driver 

This is the **MySQL driver** for the `@sqltags/core` library.

Please refer to the [@sqltags/core project README](https://github.com/brombal/sqltags/#readme) for more information.

<br>

## What is SqlTags?

🔧✨ Safely create & execute parameterized SQL queries using template strings.

```ts
const [user] = await sql`SELECT * FROM users WHERE id = ${userId}`;
```

Results in the following query:

```sql
SELECT * FROM users WHERE id = $1
-- with parameters: [123]
```

<br>

## Installation & Usage

Install:

```sh
npm install mysql2 @sqltags/mysql
```

Create a MySQL connection, then create a MySQL tag using the connection:

```ts
import mysql from 'mysql2';
import { createMySqlTag } from '@sqltags/mysql';

const connection = mysql.createConnection({ /* ... */ });
const sql = createMySqlTag(connection);
```

Query:

```ts
const [user] = await sql`SELECT * FROM users WHERE id = ${userId}`;
```

Don't forget to disconnect your client when finished!

```ts
await connection.end();
```
npm package: @sqltags/pg
Description: PostgreSQL driver for SqlTags (@sqltags/core) 🔧✨ Safely create & execute parameterized SQL queries using template strings
Author: Alex Brombal
Latest version: 0.1.0

# <img src="https://raw.githubusercontent.com/brombal/sqltags/v1/sqltags-logo.svg" width="400" alt="sqltags project logo" title="sqltags" />

![Build status](https://github.com/brombal/sqltags/actions/workflows/build-test.yml/badge.svg?branch=main)
[![npm version](https://badge.fury.io/js/@sqltags%2Fcore.svg)](https://badge.fury.io/js/@sqltags/postgres)

<br>

## SqlTags PostgreSQL driver

This is the **PostgreSQL driver** for the `@sqltags/core` library.

Please refer to the [@sqltags/core project README](https://github.com/brombal/sqltags/#readme) for
more information.

<br>

## What is SqlTags?

🔧✨ Safely create & execute parameterized SQL queries using template strings.

```ts
const [user] = await sql`SELECT * FROM users WHERE id = ${userId}`;
```

Results in the following query:

```sql
SELECT * FROM users WHERE id = $1
-- with parameters: [123]
```

<br>

## Installation & Usage

Install:

```sh
npm install @sqltags/core @sqltags/pg
```

Create & connect a PostgreSQL Client or Pool instance, then create a SQL tag using the connection:

```ts
import { Client } from 'pg';
import { createPgTag } from '@sqltags/pg';

const client = new Client({
  /* ... */
});
await client.connect();
const sql = createPgTag(client);
```

```ts
import { Pool } from 'pg';
import { createPgTag } from '@sqltags/pg';

const pool = new Pool({
  /* ... */
});
const sql = createPgTag(pool);
```

Query:

```ts
const [user] = await sql`SELECT * FROM users WHERE id = ${userId}`;
```

Don't forget to disconnect your client when finished!

```ts
await client.end();
```
npm package: @sqltags/sqlite
Description: SQLite driver for sqltags (@sqltags/core) 🔧✨ Safely create & execute parameterized SQL queries using template strings
Author: Alex Brombal
Latest version: 0.1.0

# <img src="https://raw.githubusercontent.com/brombal/sqltags/v1/sqltags-logo.svg" width="400" alt="sqltags project logo" title="sqltags" />

![Build status](https://github.com/brombal/sqltags/actions/workflows/build-test.yml/badge.svg?branch=main)
[![npm version](https://badge.fury.io/js/@sqltags%2Fcore.svg)](https://badge.fury.io/js/@sqltags/sqlite)

<br>

## SqlTags SQLite driver 

This is the **SQLite driver** for the `@sqltags/core` library.

Please refer to the [@sqltags/core project README](https://github.com/brombal/sqltags/#readme) for more information.

<br>

## What is SqlTags?

🔧✨ Safely create & execute parameterized SQL queries using template strings.

```ts
const [user] = await sql`SELECT * FROM users WHERE id = ${userId}`;
```

Results in the following query:

```sql
SELECT * FROM users WHERE id = ?
-- with parameters: [123]
```

<br>

## Installation & Usage

Install: 

```sh
npm install sqlite3 @sqltags/sqlite
```

Create a SQLite database connection, then create a SQL tag using the connection:

```ts
import s from 'sqlite3';
import { createSqliteTag } from '@sqltags/sqlite';

const db = new s.Database(':memory:');
const sql = createSqliteTag(db);
```

Query:

```ts
const [user] = await sql`SELECT * FROM users WHERE id = ${userId}`;
```
npm package: @sqltools/base-driver
Description: SQLTools Base Driver
Author: Matheus Teixeira
Latest version: 0.2.3

# SQLTools Base Driver

This package is part of [vscode-sqltools](https://vscode-sqltools.mteixeira.dev/?umd_source=repository&utm_medium=readme&utm_campaign=base-driver) extension.

## Creating icon

PNG Images
Size: 64x64px
Default Icon: Opacity 100%, no margins and paddings
Active icon: Opacity 100%, no margins and paddings, green (#00FF00) circle 24x24 bottom right
Inactive icon: Opacity 50%, no margins and paddings

## Changelog

### v0.2.3

- Support SSH tunnel that uses password.

### v0.2.2

- createSshTunnel needs to be public rather than protected.

### v0.2.1

- Use @sqltools/types@0.2.0.

### v0.2.0

- Added SSH tunneling support.

### v0.1.11

- Fix `toAbsolutePath` for Windows by using `vscode-uri`.

### v0.1.9

- Update log utility to use `@sqltools/log`.

### v0.1.8

- Using [resolve](https://www.npmjs.com/package/resolve) lib as resolver and exposed custom require and resolve functions.

### v0.1.7

- Fixes node require not working for dependencies.

### v0.1.6

- Fixes driver always asking for node runtime.

### v0.1.4

- Update @sqltool/types fixing `checkDependencies` being requred. It's optional

### v0.1.3

- Fix dynamic dependecy require issue.

### v0.1.2

First official release
npm package: @sqltools/types
Description: SQLTools interfaces and types
Latest version: 0.2.0

# SQLTools Interfaces & Types

[![GitHub](https://img.shields.io/github/license/mtxr/vscode-sqltools)](https://github.com/mtxr/vscode-sqltools/blob/dev/LICENSE)

Package with types and interfaces to develop SQLTools Plugins.

Please refer to @TBD

This package is part of [vscode-sqltools](https://vscode-sqltools.mteixeira.dev?umd_source=repository&utm_medium=readme&utm_campaign=types) extension.

# Changelog

### v0.2.0

- Add IConnectionDriver.createSshTunnel() to align with SSH tunneling support implemented in AbstractDriver in @sqltools/base-driver@0.2.0

### v0.1.7

- New 0.27.0 features:
    - `variables` property of connections. [#1064](https://github.com/mtxr/vscode-sqltools/pull/1064)
    - `disableNodeDetectNotifications` setting. [#1060](https://github.com/mtxr/vscode-sqltools/pull/1060)
    - IDriverExtensionApi.resolveConnection(). [#1066](https://github.com/mtxr/vscode-sqltools/pull/1066)
    - Connection's runtime `isPasswordResolved` property. [#1066](https://github.com/mtxr/vscode-sqltools/pull/1066)

### v0.1.6

- IBaseQueries.fetchDatabases() can optionally pass an MConnectionExplorer.IChildItem in versions after 0.23.0.

### v0.1.5

- Allow IConnection to have any properties.

### v0.1.4

- Add boolean option `highlightQuery` to extension configuration so query highlight can be disabled/enabled.

### v0.1.3

- fixed `checkDependencies` being required. It's optional

### v0.1.2

- updated IConnectionDriver to export checkDependencies internal method

### v0.1.1

- vscode-languageserver and vscode-languageclient as devDependencies instead of peerDependecies

### v0.1.0

- First release