open-index/open-npm huggingface dataset:
npm package: @seedts/adapter-mysql
Description: MySQL adapter for SeedTS
Author: SeedTS Contributors
Latest version: 0.1.1

# @seedts/adapter-mysql

MySQL adapter for SeedTS - enables database seeding with MySQL using the `mysql2` library.

## Installation

```bash
npm install @seedts/adapter-mysql mysql2
# or
pnpm add @seedts/adapter-mysql mysql2
# or
yarn add @seedts/adapter-mysql mysql2
```

## Usage

```typescript
import mysql from 'mysql2/promise';
import { MySQLAdapter } from '@seedts/adapter-mysql';
import { Seed, Action, Entity, Attribute } from '@seedts/jsx-runtime';

// Create MySQL connection pool
const pool = mysql.createPool({
  host: 'localhost',
  port: 3306,
  database: 'mydb',
  user: 'root',
  password: 'password',
  waitForConnections: true,
  connectionLimit: 10,
});

// Create adapter
const adapter = new MySQLAdapter({
  pool,
  tableName: 'users',
  database: 'mydb', // optional
  idColumn: 'id', // optional, defaults to 'id'
});

// Use with SeedTS
export const UsersSeed = () => (
  <Seed name="users" adapter={adapter}>
    <Action count={10}>
      <Entity>
        <Attribute name="id" type="number" autoIncrement />
        <Attribute
          name="email"
          type="string"
          factory={(ctx) => `user${ctx.index}@example.com`}
        />
        <Attribute name="name" type="string" factory={() => 'John Doe'} />
      </Entity>
    </Action>
  </Seed>
);
```

## Configuration

### MySQLAdapterConfig

| Option | Type | Required | Default | Description |
|--------|------|----------|---------|-------------|
| `pool` | `Pool` | Yes | - | MySQL connection pool from `mysql2/promise` |
| `tableName` | `string` | Yes | - | Name of the table to seed |
| `database` | `string` | No | - | Database name (optional prefix for queries) |
| `idColumn` | `string` | No | `'id'` | Name of the primary key column |

## Features

- ✅ Transaction support
- ✅ Connection pooling
- ✅ Prepared statements (SQL injection safe)
- ✅ Auto-increment ID handling
- ✅ Proper identifier escaping

## Methods

### insert(tableName, data)
Insert records and return inserted data with generated IDs.

### query(tableName, where?)
Query records with optional where clause.

### update(tableName, data)
Update records by ID.

### delete(tableName, where?)
Delete records with optional where clause.

### truncate(tableName)
Truncate table to remove all records.

### Transaction Methods
- `beginTransaction()` - Start a transaction
- `commit()` - Commit the transaction
- `rollback()` - Rollback the transaction

## Example with Transactions

```typescript
import { Executor } from '@seedts/core';

const executor = new Executor();
executor.registerSeed(UsersSeed());

// Run with transaction support
await executor.execute({
  transaction: true,
  verbose: true,
});

// Clean up
await adapter.close();
```

## Database Setup

```sql
CREATE DATABASE mydb;
USE mydb;

CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  name VARCHAR(255) NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
```

## License

MIT
npm package: @seedts/adapter-postgresql
Description: PostgreSQL adapter for SeedTS
Author: SeedTS Contributors
Latest version: 0.1.1

# @seedts/adapter-postgresql

PostgreSQL adapter for SeedTS - enables database seeding with PostgreSQL using the `pg` library.

## Installation

```bash
npm install @seedts/adapter-postgresql pg
# or
pnpm add @seedts/adapter-postgresql pg
# or
yarn add @seedts/adapter-postgresql pg
```

## Usage

```typescript
import { Pool } from 'pg';
import { PostgreSQLAdapter } from '@seedts/adapter-postgresql';
import { Seed, Action, Entity, Attribute } from '@seedts/jsx-runtime';

// Create PostgreSQL connection pool
const pool = new Pool({
  host: 'localhost',
  port: 5432,
  database: 'mydb',
  user: 'postgres',
  password: 'password',
});

// Create adapter
const adapter = new PostgreSQLAdapter({
  pool,
  tableName: 'users',
  schema: 'public', // optional, defaults to 'public'
  idColumn: 'id', // optional, defaults to 'id'
});

// Use with SeedTS
export const UsersSeed = () => (
  <Seed name="users" adapter={adapter}>
    <Action count={10}>
      <Entity>
        <Attribute name="id" type="number" autoIncrement />
        <Attribute
          name="email"
          type="string"
          factory={(ctx) => `user${ctx.index}@example.com`}
        />
        <Attribute name="name" type="string" factory={() => 'John Doe'} />
      </Entity>
    </Action>
  </Seed>
);
```

## Configuration

### PostgreSQLAdapterConfig

| Option | Type | Required | Default | Description |
|--------|------|----------|---------|-------------|
| `pool` | `Pool` | Yes | - | PostgreSQL connection pool from `pg` library |
| `tableName` | `string` | Yes | - | Name of the table to seed |
| `schema` | `string` | No | `'public'` | PostgreSQL schema name |
| `idColumn` | `string` | No | `'id'` | Name of the primary key column |

## Features

- ✅ Transaction support
- ✅ Schema support
- ✅ RETURNING clause for inserted records
- ✅ Parameterized queries (SQL injection safe)
- ✅ Connection pooling
- ✅ Auto-increment ID handling

## Methods

### insert(tableName, data)
Insert records and return inserted data with generated IDs.

### query(tableName, where?)
Query records with optional where clause.

### update(tableName, data)
Update records by ID.

### delete(tableName, where?)
Delete records with optional where clause.

### truncate(tableName)
Truncate table with `RESTART IDENTITY CASCADE`.

### Transaction Methods
- `beginTransaction()` - Start a transaction
- `commit()` - Commit the transaction
- `rollback()` - Rollback the transaction

## Example with Transactions

```typescript
import { Executor } from '@seedts/core';

const executor = new Executor();
executor.registerSeed(UsersSeed());

// Run with transaction support
await executor.execute({
  transaction: true, // Wraps all seeds in a transaction
  verbose: true,
});

// Clean up
await adapter.close();
```

## License

MIT
npm package: @seedts/adapter-prisma
Description: Prisma adapter for SeedTS
Author: SeedTS Contributors
Latest version: 0.1.1

# @seedts/adapter-prisma

Prisma adapter for SeedTS - enables database seeding with Prisma ORM.

## Installation

```bash
npm install @seedts/adapter-prisma @prisma/client
# or
pnpm add @seedts/adapter-prisma @prisma/client
# or
yarn add @seedts/adapter-prisma @prisma/client
```

## Usage

```typescript
import { PrismaClient } from '@prisma/client';
import { PrismaAdapter } from '@seedts/adapter-prisma';
import { Seed, Action, Entity, Attribute } from '@seedts/jsx-runtime';

// Create Prisma client
const prisma = new PrismaClient();

// Create adapter
const adapter = new PrismaAdapter({
  client: prisma,
  modelName: 'user', // lowercase model name from your Prisma schema
});

// Use with SeedTS
export const UsersSeed = () => (
  <Seed name="users" adapter={adapter}>
    <Action count={10}>
      <Entity>
        <Attribute
          name="email"
          type="string"
          factory={(ctx) => `user${ctx.index}@example.com`}
        />
        <Attribute name="name" type="string" factory={() => 'John Doe'} />
      </Entity>
    </Action>
  </Seed>
);
```

## Configuration

### PrismaAdapterConfig

| Option | Type | Required | Default | Description |
|--------|------|----------|---------|-------------|
| `client` | `PrismaClient` | Yes | - | Prisma client instance |
| `modelName` | `string` | Yes | - | Model name (lowercase, e.g., 'user', 'post') |
| `modelDelegate` | `any` | No | - | Custom model delegate (auto-inferred if not provided) |

## Features

- ✅ Transaction support (native Prisma transactions)
- ✅ Type-safe with Prisma generated types
- ✅ Automatic relation handling
- ✅ Works with all Prisma-supported databases
- ✅ Auto-increment ID handling

## Prisma Schema Example

```prisma
// schema.prisma
model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  name      String
  posts     Post[]
  createdAt DateTime @default(now())
}

model Post {
  id        Int      @id @default(autoincrement())
  title     String
  content   String?
  author    User     @relation(fields: [authorId], references: [id])
  authorId  Int
  createdAt DateTime @default(now())
}
```

## Multiple Models

```typescript
const userAdapter = new PrismaAdapter({
  client: prisma,
  modelName: 'user',
});

const postAdapter = new PrismaAdapter({
  client: prisma,
  modelName: 'post',
});
```

## Advanced: Using Prisma Transactions

The Prisma adapter includes a special `transaction()` method for advanced use cases:

```typescript
const result = await adapter.transaction(async (txAdapter) => {
  // Use txAdapter inside the transaction
  const users = await txAdapter.insert('users', userData);
  return users;
});
```

## TypeScript Types

```typescript
import { PrismaClient, User } from '@prisma/client';
import { PrismaAdapter } from '@seedts/adapter-prisma';

const adapter = new PrismaAdapter<User>({
  client: prisma,
  modelName: 'user',
});
```

## Cleanup

```typescript
// Close Prisma connection
await adapter.close();
```

## License

MIT
npm package: @seedui-react/seedui
Description: This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Latest version: 0.1.32

# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh