30 lines
529 B
JavaScript
30 lines
529 B
JavaScript
|
import { PrismaClient } from "@prisma/client";
|
||
|
|
||
|
const client = new PrismaClient();
|
||
|
|
||
|
client.$connect();
|
||
|
console.log("conected");
|
||
|
function createuser() {
|
||
|
client.user
|
||
|
.create({
|
||
|
data: {
|
||
|
email: "exemple@gmrgerail.com",
|
||
|
pswd: "1234",
|
||
|
username: "lazlor",
|
||
|
},
|
||
|
})
|
||
|
.then(() => {});
|
||
|
}
|
||
|
//createuser();
|
||
|
|
||
|
async function getuser(req, res) {
|
||
|
const posts = await client.user.findMany({
|
||
|
where: {
|
||
|
username: "lazlor",
|
||
|
},
|
||
|
});
|
||
|
console.log(posts);
|
||
|
}
|
||
|
getuser();
|
||
|
client.$disconnect();
|