Jacob | idohtml
Jacob | idohtml
Explore posts from servers
PPrisma
Created by Jacob | idohtml on 4/17/2025 in #help-and-questions
output in schema
Tell me if I am correct or not?
15 replies
PPrisma
Created by Jacob | idohtml on 4/17/2025 in #help-and-questions
output in schema
Maybe you could verify my statement here?
15 replies
PPrisma
Created by Jacob | idohtml on 4/17/2025 in #help-and-questions
output in schema
However you need to keep in mind that when you use the old way (removing the output) you are using an older way of doing things and in your console you will get this warning from prisma meaning it's highly recommended to have an output or setting up an output
Prisma schema loaded from prisma/schema.prisma
Warning: You did not specify an output path for your `generator` in schema.prisma. This behavior is deprecated and will no longer be supported in Prisma 7.0.0. To learn more visit https://pris.ly/cli/output-path
Prisma schema loaded from prisma/schema.prisma
Warning: You did not specify an output path for your `generator` in schema.prisma. This behavior is deprecated and will no longer be supported in Prisma 7.0.0. To learn more visit https://pris.ly/cli/output-path
15 replies
PPrisma
Created by Jacob | idohtml on 4/17/2025 in #help-and-questions
output in schema
Here is a video from the Prisma YouTube channel that explains it very well. https://www.youtube.com/watch?v=HKM4uTXS_Uw
15 replies
PPrisma
Created by Jacob | idohtml on 4/17/2025 in #help-and-questions
output in schema
Sorry I completely forgot to reply and I didn't even get a notice on this. So what I did was I removed the output = completely and what happens then you run the npx prisma generate cli is that when you generate your files in your node_modules you will find a prisma file with all the prisma needed code but if you want to have a specific output you can always set that to output = "../generated/prisma/client" and that will end up next to your app router or in the root of the project. You could also change this
generator client {
provider = "prisma-client-js"
}
generator client {
provider = "prisma-client-js"
}
to this
generator client {
provider = "prisma-client"
}
generator client {
provider = "prisma-client"
}
and that will give you a TS version from my understanding of the prisma client files.
15 replies
PPrisma
Created by Jacob | idohtml on 4/17/2025 in #help-and-questions
output in schema
About an hour or two?
15 replies
PPrisma
Created by Jacob | idohtml on 4/17/2025 in #help-and-questions
output in schema
I fixed it but I am not currently at home to explain it for you 😂
15 replies
BABetter Auth
Created by Jacob | idohtml on 4/18/2025 in #help
server actions for users
Thanks again Kinfish 😂 ❤️
8 replies
BABetter Auth
Created by Jacob | idohtml on 4/18/2025 in #help
server actions for users
That explains that struggle prettier clearly as well
8 replies
BABetter Auth
Created by Jacob | idohtml on 4/18/2025 in #help
server actions for users
Well then
8 replies
BABetter Auth
Created by Jacob | idohtml on 4/18/2025 in #help
server actions for users
So how I usually prefer to setup my users action is in a user.actions.ts file inside the actions directory. Here I place all the server actions a user should be able to do such as sign in a user with credentials, sign out a user, sign in, get the user id or update their profile in some sort of way. But since Better-auth already seems to have this built into their api (auth.api... or authClient.api...) I don't really know how to setup this file anymore and it's a bit confusing to me.
8 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
Well however. Thank you so, so much for the help provided. I appreciated it highly mate 🙏
25 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
That's so good to know
25 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
I used to do it like this before
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
25 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
Yeah seems to work now but I still don't understand why I need that output thing?
25 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
ryt?
25 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
Like this right?
import { PrismaClient } from "@/prisma/app/generated/prisma/client";

const prismaClientSingleton = () => {
return new PrismaClient();
};

declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
} & typeof global;

const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();

export default prisma;

if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;
import { PrismaClient } from "@/prisma/app/generated/prisma/client";

const prismaClientSingleton = () => {
return new PrismaClient();
};

declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
} & typeof global;

const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();

export default prisma;

if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;
25 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
import { PrismaClient } from "@prisma/client";

const prismaClientSingleton = () => {
return new PrismaClient();
};

declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
} & typeof global;

const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();

export default prisma;

if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;
import { PrismaClient } from "@prisma/client";

const prismaClientSingleton = () => {
return new PrismaClient();
};

declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
} & typeof global;

const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();

export default prisma;

if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;
25 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import { nextCookies } from "better-auth/next-js";
import prisma from "./database/prisma";

export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "postgresql",
}),
secret: process.env.AUTH_SECRET!,
emailAndPassword: {
enabled: true,
autoSignIn: false,
},
plugins: [nextCookies()],
});
import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import { nextCookies } from "better-auth/next-js";
import prisma from "./database/prisma";

export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "postgresql",
}),
secret: process.env.AUTH_SECRET!,
emailAndPassword: {
enabled: true,
autoSignIn: false,
},
plugins: [nextCookies()],
});
25 replies
BABetter Auth
Created by Jacob | idohtml on 4/17/2025 in #help
Prisma + better-auth: schema type issue
I have done that multiple time but I still get the same error when i fill in the sign up form
25 replies