
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
prisma-libs
Advanced tools
A modern, type-safe database library built with Prisma ORM. This package provides a clean and intuitive API for database operations with full TypeScript support.
npm install prisma-libs
Create a .env file in your project root:
DATABASE_URL="postgresql://username:password@localhost:5432/your_database_name"
npx prisma generate
npx prisma db push
import { prisma, userUtils, postUtils, connectDatabase } from 'prisma-libs';
async function main() {
// Connect to database
await connectDatabase();
// Create a user
const user = await userUtils.createUser('john@example.com', 'John Doe');
console.log('Created user:', user);
// Create a post
const post = await postUtils.createPost(
'My First Post',
'This is the content of my first post.',
user.id,
true
);
console.log('Created post:', post);
// Find user with posts
const userWithPosts = await userUtils.findUserById(user.id);
console.log('User with posts:', userWithPosts);
}
main().catch(console.error);
prisma: Singleton Prisma client instancePrismaClient: Prisma client classUser, Post: Generated TypeScript typesimport { connectDatabase, disconnectDatabase, healthCheck } from 'prisma-libs';
// Connect to database
await connectDatabase();
// Check database health
const isHealthy = await healthCheck();
// Disconnect from database
await disconnectDatabase();
import { userUtils } from 'prisma-libs';
// Create a new user
const user = await userUtils.createUser('email@example.com', 'User Name');
// Find user by email
const user = await userUtils.findUserByEmail('email@example.com');
// Find user by ID (includes posts)
const user = await userUtils.findUserById('user-id');
// Update user
const updatedUser = await userUtils.updateUser('user-id', {
name: 'New Name',
email: 'newemail@example.com'
});
// Delete user
await userUtils.deleteUser('user-id');
// Get all users
const users = await userUtils.getAllUsers();
import { postUtils } from 'prisma-libs';
// Create a new post
const post = await postUtils.createPost(
'Post Title',
'Post content',
'author-user-id',
true // published
);
// Find post by ID (includes author)
const post = await postUtils.findPostById('post-id');
// Find posts by author
const posts = await postUtils.findPostsByAuthor('author-user-id');
// Update post
const updatedPost = await postUtils.updatePost('post-id', {
title: 'New Title',
published: true
});
// Delete post
await postUtils.deletePost('post-id');
// Get all posts
const posts = await postUtils.getAllPosts();
// Get only published posts
const publishedPosts = await postUtils.getPublishedPosts();
import { setupGracefulShutdown } from 'prisma-libs';
// Set up graceful shutdown handlers
setupGracefulShutdown();
The package includes a sample schema with User and Post models:
model User {
id String @id @default(cuid())
email String @unique
name String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
posts Post[]
@@map("users")
}
model Post {
id String @id @default(cuid())
title String
content String?
published Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
authorId String
@@map("posts")
}
npm installenv.example to .env and configure your database URLnpm run generatenpm run db:pushnpm run db:seednpm run build - Build the TypeScript codenpm run dev - Watch mode for developmentnpm run generate - Generate Prisma clientnpm run db:push - Push schema changes to databasenpm run db:migrate - Create and apply migrationsnpm run db:studio - Open Prisma Studionpm run db:seed - Seed the database with sample dataMIT License - see LICENSE file for details.
For issues and questions, please open an issue on GitHub. # prisma-libs
FAQs
Prisma schema and migrations for database management
We found that prisma-libs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.