TypeORM REST API
TypeScript and JavaScript ORM for SQL and NoSQL databases
TypeORM is a powerful Object-Relational Mapping (ORM) library that runs in Node.js and supports TypeScript and JavaScript. It enables developers to work with databases using object-oriented programming patterns while supporting multiple database systems including PostgreSQL, MySQL, MariaDB, SQLite, MS SQL Server, Oracle, and MongoDB. TypeORM provides features like Active Record and Data Mapper patterns, migrations, eager and lazy relations, and comprehensive TypeScript support.
http://localhost:3000/api
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /entities/{entityName} | Retrieve all records for a specific entity with optional filtering, sorting, and pagination |
| GET | /entities/{entityName}/{id} | Retrieve a single record by ID for a specific entity including relations |
| POST | /entities/{entityName} | Create a new record for the specified entity with validation |
| PUT | /entities/{entityName}/{id} | Update an existing record by ID with partial or full data |
| DELETE | /entities/{entityName}/{id} | Delete a record by ID and optionally cascade to related entities |
| POST | /query/raw | Execute raw SQL queries with parameter binding for complex operations |
| POST | /query/builder | Execute advanced queries using TypeORM QueryBuilder JSON syntax |
| GET | /metadata/{entityName} | Retrieve entity metadata including columns, relations, and indexes |
| GET | /migrations | List all available migrations with their execution status |
| POST | /migrations/run | Execute pending migrations to update database schema |
| POST | /migrations/revert | Revert the most recently executed migration |
| GET | /relations/{entityName}/{id}/{relationName} | Load specific relations for an entity instance with lazy loading |
| POST | /transaction | Execute multiple operations within a database transaction atomically |
| GET | /connection/status | Check database connection status and connection pool statistics |
| POST | /cache/clear | Clear query result cache for specific entities or all cached queries |
Code Examples
# Retrieve all users with filtering
curl -X GET 'http://localhost:3000/api/entities/User?where={"isActive":true}&take=10&skip=0' \
-H 'Authorization: Bearer your_api_token_here' \
-H 'Content-Type: application/json'
# Create a new user
curl -X POST 'http://localhost:3000/api/entities/User' \
-H 'Authorization: Bearer your_api_token_here' \
-H 'Content-Type: application/json' \
-d '{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"isActive": true
}'
Connect TypeORM to AI
Deploy a TypeORM MCP server on IOX Cloud and connect it to Claude, ChatGPT, Cursor, or any AI client. Your AI assistant gets direct access to TypeORM through these tools:
query_entity
Query any TypeORM entity with natural language filters, automatically translating to TypeORM QueryBuilder syntax
create_entity
Create new database records with automatic validation and relationship handling based on entity definitions
generate_migration
Analyze entity changes and automatically generate migration files to synchronize database schema
analyze_relationships
Explore and visualize entity relationships, foreign keys, and join strategies for query optimization
execute_transaction
Execute multiple database operations atomically within a transaction with automatic rollback on errors
Deploy in 60 seconds
Describe what you need, AI generates the code, and IOX deploys it globally.
Deploy TypeORM MCP Server →