datasource db { provider = "sqlite" url = "file:./dev.db" } Open prisma/schema.prisma and add models. Example:
import { PrismaClient } from '@prisma/client'; const prisma = new PrismaClient(); Prisma Ts Software Download
async function main() { const user = await prisma.user.create({ data: { email: 'alice@example.com', name: 'Alice' }, }); console.log(user); } main() .catch(e => console.error(e)) .finally(async () => await prisma.$disconnect()); Run with ts-node: datasource db { provider = "sqlite" url = "file:
import { PrismaClient } from '@prisma/client'; const prisma = new PrismaClient(); Create a file src/index.ts: const prisma = new PrismaClient()
npx prisma generate Import in TypeScript:
npx ts-node src/index.ts Open Studio to inspect data:
Located deep in the heart of Texas, Belton is a unique city with friendly people and a rich history. Founded in 1850, Belton is located along the famous Chisholm Trail. Belton’s location also puts it squarely in the middle of natural wonders, shopping, and entertainment.
Sorry, this website uses features that your browser doesn’t support. Upgrade to a newer version of Firefox, Chrome, Safari, or Edge and you’ll be all set.