Enterprise-grade user interface for converting natural language questions into SQL queries across multiple database dialects.
- Multi-Database Support: Snowflake, PostgreSQL, MySQL, and Databricks/Spark SQL
- Interactive Query Builder: Simple, intuitive interface for business users
- Database Catalog Management: Define your schema, tables, and columns
- Governance & Security: Row-level security, PII protection, tenant filtering
- One-Click Copy/Download: Easy SQL export functionality
- Quality Checks: Automatic validation of generated queries
- Business Glossary: Define custom metrics and terminology
npm installnpm run devThe application will start on http://localhost:3000
npm run build
npm run previewChoose your target database from the dropdown:
- Snowflake
- PostgreSQL
- MySQL
- Databricks (Spark SQL)
Click "Add Table" in the Database Catalog section to define your tables:
Schema: sales
Table: orders
Columns:
order_id:INT
customer_id:INT
order_date:TIMESTAMP
total_amount:DECIMAL(10,2)
status:VARCHAR(50)
Click "Settings" to configure:
- Row-Level Security: Add tenant filters
- PII Protection: List columns to exclude
- Timezone Settings: Set your default timezone
- Query Defaults: Configure time ranges and row limits
- Business Glossary: Define custom metrics
Enter your question in plain English:
Show me the top 10 customers by revenue in the last quarter
Click "Generate SQL" or press Cmd/Ctrl + Enter. Your SQL will be generated with:
- Syntax highlighting
- One-click copy to clipboard
- Download as .sql file
- Quality checks summary
- Assumptions made
Click "Load Example" to see a pre-configured setup with:
- Sample sales and customer tables
- Governance rules
- Example questions
The UI includes a service layer (src/services/queryService.ts) that can be connected to your backend API.
The app currently runs in mock mode for testing. Replace generateSQLMock() with actual API calls:
// In src/App.tsx, replace:
const result = await queryService.generateSQLMock(request);
// With:
const result = await queryService.generateSQL(request);Configure your API endpoint in src/services/queryService.ts:
const queryService = new QueryService('https://your-api.com/api');{
"dialect": "snowflake",
"user_question": "Show me top 10 customers by revenue",
"catalogs": [
{
"schema": "sales",
"table": "orders",
"columns": [
{ "name": "order_id", "type": "INT" }
]
}
],
"governance": {
"tenant_filter": { "column": "tenant_id", "value": "tenant_123" },
"pii_columns": ["email", "ssn"],
"rls_predicates": ["status != 'deleted'"],
"date_timezone": "UTC"
},
"defaults": {
"time_range_default": "LAST 90 DAYS",
"limit_default": 100
},
"mode": {
"no_clarify": false
}
}{
"sql": "SELECT ... FROM ... WHERE ...",
"dialect": "snowflake",
"summary": "Retrieving top 10 customers by revenue",
"assumptions": [
"Using default time range of last 90 days",
"Applied row limit of 100"
],
"parameters": {
"start_date": "2024-01-01",
"end_date": "2024-03-31"
},
"quality_checks": {
"joins_reviewed": true,
"filters_apply_rls": true,
"uses_indices_or_partitions": true,
"select_star_avoided": true,
"limit_applied": true
},
"clarification_question": ""
}src/
├── components/
│ ├── SQLOutput.tsx # SQL display with copy/download
│ ├── CatalogManager.tsx # Database schema management
│ └── GovernancePanel.tsx # Security & settings
├── services/
│ └── queryService.ts # API integration layer
├── types/
│ └── index.ts # TypeScript definitions
├── App.tsx # Main application
├── main.tsx # Entry point
└── index.css # Styles
- React 18 - UI framework
- TypeScript - Type safety
- Vite - Build tool
- Tailwind CSS - Styling
- Lucide React - Icons
- React Syntax Highlighter - SQL highlighting
Modify colors in tailwind.config.js:
colors: {
primary: {
500: '#0ea5e9',
600: '#0284c7',
// ...
},
}Update src/types/index.ts:
export type DatabaseDialect = 'snowflake' | 'postgres' | 'mysql' | 'databricks' | 'oracle';- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- All governance rules are enforced at the API level
- PII columns should be filtered server-side
- Row-level security predicates must be validated
- Never expose sensitive credentials in the frontend
Build and deploy to any static hosting provider:
npm run build
# Deploy the 'dist' folderFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "run", "preview"]For issues and feature requests, please contact your development team.
Proprietary - All rights reserved