Skip to content

safe-sql

by official

Data

Generate SQL with safety checks

data sql safety
# safe-sql

Generate SQL with safety checks

## Installation

This is a CmdForge tool. Install it via:

```bash
cmdforge install safe-sql
```

## Usage

Use `safe-sql` by piping natural language descriptions of your SQL query:

```bash
echo "Get all users who signed up in the last 30 days" | safe-sql
```

```bash
echo "Create a table for storing product inventory" | safe-sql --dialect MySQL
```

```bash
cat requirements.txt | safe-sql
```

## Arguments

| Flag | Default | Description |
|------|---------|-------------|
| `--dialect` | PostgreSQL | SQL dialect to generate (e.g., PostgreSQL, MySQL, SQLite) |

## How It Works

1. **Generate SQL** (`step_1`): Sends your request to Claude Haiku to generate SQL for the specified dialect
2. **Safety Validation** (`step_2`): Runs safety checks on the generated SQL to catch potential issues
3. **Output**: Returns the validated SQL query

## Dependencies

None

No reviews yet.

Issues

No issues reported for this tool.