- Home
- Skills
- Data & Databases
- Freebies — Basic SQL Crud Generator
Works with the AI Agents you already use
Freebies — Basic SQL Crud Generator
Generate secure, parameterized SQL CRUD queries and indexes for PostgreSQL, MySQL, and SQLite.
Free
Freebies — Basic SQL Crud Generator
Example session with this skill installed
Generate PostgreSQL CRUD queries for a 'users' table with id (PK), email (unique), password_hash, and created_at. Include an index for email.
- Read your context and instructions
- Compiled the freebies
I have generated the PostgreSQL CRUD queries for the users table. All queries use bind variables to ensure security and include timestamp tracking and indexing.
Users Table CRUD Operations (PostgreSQL)
-- Schema Definition
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
password_hash TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
-- Indexes for performance
CREATE INDEX idx_users_email ON users(email);
-- CREATE (Insert)
INSERT INTO users (email, password_hash)
VALUES ($1, $2)
RETURNING id, created_at;
-- READ (Select by ID)
SELECT id, email, password_hash, created_at, updated_at
FROM users
WHERE id = $1;
-- READ (Select by Email)
SELECT id, email, password_hash, created_at, updated_at
FROM users
WHERE email = $1;
-- UPDATE
UPDATE users
SET email = $1,
password_hash = $2,
updated_at = CURRENT_TIMESTAMP
WHERE id = $3;
-- DELETE
DELETE FROM users
WHERE id = $1;
Next steps
- Review the
updated_attrigger requirements if your environment requires a manual trigger function for PostgreSQL. - Add additional indexes for columns frequently used in
ORDER BYorJOINclauses. - Integrate these queries into your data access layer using a library like
pg-promiseorsqlx.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual SQL writing is error-prone and often leads to SQL injection vulnerabilities. This skill automates the creation of production-ready, parameterized CRUD queries for relational databases.
What it does
- Multi-dialect support handles syntax variations for PostgreSQL, MySQL, and SQLite.
- Parameterized queries uses bind variables like
$1or?to prevent injection attacks. - Relational integrity incorporates primary keys, foreign keys, and timestamp tracking columns.
- Performance scaffolding generates index creation statements for columns used in filters.
How it works
- Identify the dialect to ensure syntax compatibility for your target database.
- Define the schema based on the provided table structure and relationships.
- Generate CRUD operations including SELECT, INSERT, UPDATE, and DELETE.
- Append optimization by providing sample index statements for frequent query paths.
Frameworks & tools
This skill supports PostgreSQL, MySQL, and SQLite. It adheres to standard relational database patterns and produces syntax-compliant SQL scripts.
Why this beats prompting it yourself
Generic prompts often return string-concatenated queries that are vulnerable to attacks. This skill strictly enforces parameter markers and relational constraints, ensuring every query follows database engineering best practices by default.
Use cases
- Generating boilerplate repository layer code for new features.
- Creating migration scripts for tables with complex foreign key relations.
- Building secure data access layers for public-facing APIs.
- Setting up initial database schemas with proper indexing.
Known limitations
Focuses on standard CRUD operations and does not handle complex analytical window functions or specific NoSQL syntax. Requires clear table definitions to map foreign keys accurately.
Limited to PostgreSQL, MySQL, and SQLite. Does not support complex analytical window functions or NoSQL databases.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 2 days ago
- Free with an Agensi account
Requires
Permissions
Target Use Cases: - Generate parameterized SQL CRUD queries for PostgreSQL. - Write an INSERT and SELECT query with JOINs in MySQL. - Create standard SQL CRUD statements for a table.