TARS
TARS
Explore posts from servers
DTDrizzle Team
Created by TARS on 10/9/2024 in #help
Cant drizzle-kit pull with next.js from supabase postgres
Hello, trying to learn drizzle by connecting it to an existing supabase project (postgres), and need to pull the DB schemas into drizzle. My drizzle.config.ts:
import { config } from "dotenv";
import { defineConfig } from "drizzle-kit";
config({ path: ".env.local" });
export default defineConfig({
schema: "./src/db/schema.ts",
out: "./db/migrations",
dialect: "postgresql",
dbCredentials: {
url: process.env.NEXT_PRIVATE_DB_CONNECTION_STRING!,
},

});
import { config } from "dotenv";
import { defineConfig } from "drizzle-kit";
config({ path: ".env.local" });
export default defineConfig({
schema: "./src/db/schema.ts",
out: "./db/migrations",
dialect: "postgresql",
dbCredentials: {
url: process.env.NEXT_PRIVATE_DB_CONNECTION_STRING!,
},

});
$ npx drizzle-kit pull No config path provided, using default 'drizzle.config.ts' Reading config file 'C:\webdev\sprent-backoffice\drizzle.config.ts' Pulling from ['public'] list of schemas Using 'pg' driver for database querying [⣟] 0 tables fetching [⣟] 0 columns fetching [⣟] 0 enums fetching [⣟] 0 indexes fetching [⣟] 0 foreign keys fetching Error: SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing Not sure where to start solving this issue.. help would be most appreciated!
8 replies
PPrisma
Created by TARS on 8/2/2024 in #help-and-questions
npx prisma generate wont update the Product model.
Hey, I'm working on a simple e-commerce with next.js/prisma. And when I update the Product model the client doesn't update the types for Product. Here is the prisma.schema model Product:
model Product {
id String @id @default(uuid())
name String
description String
priceInCents Int
isActive Boolean @default(true)
isFeatured Boolean @default(false)
media Media[] @relation("ProductMedia")
orderItems OrderProduct[] @relation("ProductOrderProducts")
shippingCostInCents Int?

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Product {
id String @id @default(uuid())
name String
description String
priceInCents Int
isActive Boolean @default(true)
isFeatured Boolean @default(false)
media Media[] @relation("ProductMedia")
orderItems OrderProduct[] @relation("ProductOrderProducts")
shippingCostInCents Int?

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
Here is what I get from importing the Product type from @prisma/client
(alias) type Product = {
id: string;
name: string;
description: string;
priceInCents: number;
isActive: boolean;
isFeatured: boolean;
shippingCostInCents: number | null;
createdAt: Date;
updatedAt: Date;
}
import Product
(alias) type Product = {
id: string;
name: string;
description: string;
priceInCents: number;
isActive: boolean;
isFeatured: boolean;
shippingCostInCents: number | null;
createdAt: Date;
updatedAt: Date;
}
import Product
When I migrate the new schema to the db, it successfully reflects the changes I made to Product model, the media relation. I've deleted modules, reinstalled the client, rebooted the computer. What can I try more?
4 replies
KKinde
Created by TARS on 2/6/2024 in #💻┃support
Can't get the user info from const { getUser } = getKindeServerSession();
I must be totally braindead but I'm just trying to get the information about the user in this way. Using next.js. import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";
```
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";

const Page = () => {
const { getUser } = getKindeServerSession();
const user = getUser();

return (
<MpWrapper className="mt-32">
<h1>Dashboard</h1>
<p>User: {user.email}</p>
</MpWrapper>
);
};
```
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";

const Page = () => {
const { getUser } = getKindeServerSession();
const user = getUser();

return (
<MpWrapper className="mt-32">
<h1>Dashboard</h1>
<p>User: {user.email}</p>
</MpWrapper>
);
};
Property 'email' does not exist on type 'Promise<KindeUser | null>'. Isn't it supposed to be an object? I'm logged in and everthing. I'm every writing exactly as Josh tried coding does
27 replies