prisma-console
v1.1.2
Published
A Rails-inspired interactive console for Prisma ORM with project-scoped functionality
Maintainers
Readme
Prisma Console
A Rails-inspired interactive console for Prisma ORM that provides a powerful REPL environment for interacting with your database.
Features
✨ Rails-like Experience
- Direct model access without prisma prefix
- Interactive query execution
- Command history support
- Tab completion
🎨 Beautiful Output
- Colorized query results
- Formatted JSON output
- Clear error messages
- Null/undefined handling
🔧 Developer Friendly
- Run any JavaScript code
- Full async/await support
- Access to Prisma models and queries
- Command history persistence
Installation
Add to your Prisma project:
npm install prisma-consoleUsage
Start the console:
npx prisma-consoleOr add it to your package.json scripts:
{
"scripts": {
"console": "prisma-console"
}
}Then run:
npm run consoleExample Commands
// List all models
models
// Find all users
prisma.user.findMany()
// Create a new user
prisma.user.create({
data: {
name: "John",
email: "[email protected]"
}
})
// Query with relations
prisma.user.findMany({
include: {
posts: true,
profile: true
}
})
// Run any JavaScript
const admins = await prisma.user.findMany({ where: { role: "ADMIN" }})
admins.map(a => a.email)Requirements
- Node.js >= 14.0.0
- A Prisma project with:
- Valid schema.prisma file
- Generated Prisma Client (
npx prisma generate) - Configured database connection
Contributing
Contributions are welcome! Here's how you can help:
Areas for Contribution
- 🐛 Bug fixes
- ✨ New features
- 📝 Documentation improvements
- 🎨 UI/UX enhancements
- ⚡ Performance optimizations
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/zaidzuhaira/prisma-console.git - Install dependencies:
npm install - Create a branch:
git checkout -b my-feature - Make your changes
- Submit a pull request
Development Guidelines
- Follow existing code style
- Add tests for new features
- Update documentation as needed
- Keep pull requests focused on single features/fixes
License
ISC
Support
If you find a bug or have a feature request, please open an issue.
