Welcome to the MTS Shop Database! This project uses Prisma as an Object-Relational Mapping (ORM) tool to interact with the database. It's designed to support the data needs of the MTS Shop application.
Before you get started, make sure you have the following prerequisites installed:
- Node.js
- Prisma CLI
- MySQL (or your preferred database system)
- Clone this repository to your local machine.
git clone https://github.com/pathan-mehedi/mts-shopDB-prisma.git
- Install the project dependencies.
cd mts-shopDB-prisma
npm install
- Configure your database connection in the
schema.prisma
file. Replace<your-database-name>
with your actual database name (e.g., "mts_shopDB-prisma").
// schema.prisma
generator client {
provider = "prisma-client-js"
output = "./node_modules/@prisma/client"
}
// ...
datasource db {
provider = "postgresql"
url = env("DATABASE_URL") // Replace with your database connection URL
}
// ...
- Generate the Prisma Client.
npx prisma generate
Now that you've set up the MTS Shop database with Prisma, you can use the Prisma Client to interact with your database. You can define models and create, read, update, or delete records.
You can run Prisma commands like:
npx prisma db push
to apply database schema changes.npx prisma generate
to regenerate the Prisma Client.- Use the Prisma Client to perform database operations in your application.
const { PrismaClient } = require("@prisma/client");
const prisma = new PrismaClient();
async function main() {
// Your database operations here
const user = await prisma.user.create({
data: {
name: "John Doe",
email: "[email protected]",
},
});
console.log("User created:", user);
}
main()
.catch((e) => {
throw e;
})
.finally(async () => {
await prisma.$disconnect();
});
This project is licensed under the MIT License. See the LICENSE file for details.
The README file now includes the updated repository link.
mts-shopdb-prisma's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.