Helix
Helix
Explore posts from servers
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
It is not, I can send you over a zip file of the project, or I can make it public temporarily. I can also send over any files you need.
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
Almost like it wouldn’t install properly but it was installed and I could see it in my node_modules
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
It was failing to import in my next.config.js
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
Any ideas?
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
I have tried the fix in the error logs but it fails to import the monorepo fix in the next.config.js
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
I forgot to import the client from the outputs. I'm having a new issue though, whenever I try to deploy my site to heroku I am getting
2024-11-21T20:08:41.878893+00:00 app[web.1]: PrismaClientInitializationError:
2024-11-21T20:08:41.878904+00:00 app[web.1]: Invalid `prisma.user.findUnique()` invocation:
2024-11-21T20:08:41.878904+00:00 app[web.1]:
2024-11-21T20:08:41.878905+00:00 app[web.1]:
2024-11-21T20:08:41.878905+00:00 app[web.1]: Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".
2024-11-21T20:08:41.878905+00:00 app[web.1]:
2024-11-21T20:08:41.878906+00:00 app[web.1]: We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.
2024-11-21T20:08:41.878906+00:00 app[web.1]:
2024-11-21T20:08:41.878909+00:00 app[web.1]: This is likely caused by a bundler that has not copied "libquery_engine-debian-openssl-3.0.x.so.node" next to the resulting bundle.
2024-11-21T20:08:41.878909+00:00 app[web.1]: Ensure that "libquery_engine-debian-openssl-3.0.x.so.node" has been copied next to the bundle or in "node_modules/@internal/aero/client".
2024-11-21T20:08:41.878893+00:00 app[web.1]: PrismaClientInitializationError:
2024-11-21T20:08:41.878904+00:00 app[web.1]: Invalid `prisma.user.findUnique()` invocation:
2024-11-21T20:08:41.878904+00:00 app[web.1]:
2024-11-21T20:08:41.878905+00:00 app[web.1]:
2024-11-21T20:08:41.878905+00:00 app[web.1]: Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".
2024-11-21T20:08:41.878905+00:00 app[web.1]:
2024-11-21T20:08:41.878906+00:00 app[web.1]: We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.
2024-11-21T20:08:41.878906+00:00 app[web.1]:
2024-11-21T20:08:41.878909+00:00 app[web.1]: This is likely caused by a bundler that has not copied "libquery_engine-debian-openssl-3.0.x.so.node" next to the resulting bundle.
2024-11-21T20:08:41.878909+00:00 app[web.1]: Ensure that "libquery_engine-debian-openssl-3.0.x.so.node" has been copied next to the bundle or in "node_modules/@internal/aero/client".
this error now.
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
I figured it out!
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
export const aero_db = new PrismaClient({
datasources: { db: { url: env.DATABASE_URL } },
});
export const alec_site_db = new PrismaClient({
datasources: { db: { url: env.ALEC_SITE_DB_URL } },
});
export const aero_db = new PrismaClient({
datasources: { db: { url: env.DATABASE_URL } },
});
export const alec_site_db = new PrismaClient({
datasources: { db: { url: env.ALEC_SITE_DB_URL } },
});
this is the prisma clients
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
// schema1.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters", "prismaSchemaFolder", "multiSchema"]
output = "../node_modules/@internal/prisma-first/client"
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}

// schema2.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters", "prismaSchemaFolder", "multiSchema"]
output = "../node_modules/@internal/prisma-second/client"
}

datasource db {
provider = "mysql"
url = env("ALEC_SITE_DB_URL")
}
// schema1.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters", "prismaSchemaFolder", "multiSchema"]
output = "../node_modules/@internal/prisma-first/client"
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}

// schema2.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters", "prismaSchemaFolder", "multiSchema"]
output = "../node_modules/@internal/prisma-second/client"
}

datasource db {
provider = "mysql"
url = env("ALEC_SITE_DB_URL")
}
I have two different database schemas one called aero and one called alec_site that I'm trying to connect to, aero contains the user data & app specific data where alec_site contains other data that I need. I'm not getting any specific errors besides Property 'vendor_id_walmart' does not exist on type 'PrismaClient<{ datasources: { db: { url: string; }; }; }, never, DefaultArgs>'. for the alec_site db.
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters", "prismaSchemaFolder", "multiSchema"]
output = "../node_modules/@internal/prisma-second/client"
}

datasource db {
provider = "mysql"
url = env("ALEC_SITE_DB_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters", "prismaSchemaFolder", "multiSchema"]
output = "../node_modules/@internal/prisma-second/client"
}

datasource db {
provider = "mysql"
url = env("ALEC_SITE_DB_URL")
}
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters", "prismaSchemaFolder", "multiSchema"]
}

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

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
19 replies
PPrisma
Created by Helix on 11/18/2024 in #help-and-questions
Two Schemas but only one will stay generated at a time
import { PrismaClient } from "@prisma/client";

import { env } from "@/env";
const createPrismaClient = (url: string) =>
new PrismaClient({
log:
env.NODE_ENV === "development"
? ["query", "error", "warn"]
: ["error"],
datasources: {
db: {
url: url,
},
},
});

const globalForPrisma = globalThis as unknown as {
prisma: ReturnType<typeof createPrismaClient> | undefined;
};

export const aero_db =
globalForPrisma.prisma ?? createPrismaClient(env.DATABASE_URL);
export const alec_site_db = createPrismaClient(env.ALEC_SITE_DB_URL);

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

import { env } from "@/env";
const createPrismaClient = (url: string) =>
new PrismaClient({
log:
env.NODE_ENV === "development"
? ["query", "error", "warn"]
: ["error"],
datasources: {
db: {
url: url,
},
},
});

const globalForPrisma = globalThis as unknown as {
prisma: ReturnType<typeof createPrismaClient> | undefined;
};

export const aero_db =
globalForPrisma.prisma ?? createPrismaClient(env.DATABASE_URL);
export const alec_site_db = createPrismaClient(env.ALEC_SITE_DB_URL);

if (env.NODE_ENV !== "production") globalForPrisma.prisma = aero_db;
19 replies
TTCTheo's Typesafe Cult
Created by Helix on 7/25/2024 in #questions
Auth Library Suggestions
10 replies
TTCTheo's Typesafe Cult
Created by Helix on 7/25/2024 in #questions
Auth Library Suggestions
I've got lucia pretty much setup, but the ASWebAuthenticationSession is looking for a callback url, which I dont seem to be getting.
10 replies
TTCTheo's Typesafe Cult
Created by Helix on 7/25/2024 in #questions
Auth Library Suggestions
The web end will be yes (besides having other functionality besides just auth), the on device is native swift.
10 replies
TTCTheo's Typesafe Cult
Created by Helix on 7/24/2024 in #questions
NextAuth Callbacks
I’ve updated my callback url to the correct url and it’s returning the scheme and host but not the token
9 replies
TTCTheo's Typesafe Cult
Created by Helix on 7/24/2024 in #questions
NextAuth Callbacks
9 replies
TTCTheo's Typesafe Cult
Created by Helix on 7/24/2024 in #questions
NextAuth Callbacks
I have added a accessToken return to the session callback method but I am not seeing any response on the iOS app
9 replies
DTDrizzle Team
Created by Helix on 7/18/2024 in #help
Querying Views
Nevermind, needed to add existing to the end of the schema definitioj
2 replies
DTDrizzle Team
Created by Helix on 7/12/2024 in #help
Drizzle and Turso not showing live data.
Weirdly enough I just made a test route
import { NextRequest, NextResponse } from 'next/server';
import { config } from "dotenv";
import { createClient } from '@libsql/client';

export const runtime = 'nodejs';

config({ path: ".env" });

export async function GET(req: NextRequest) {
const client = createClient({
url: process.env.TURSO_CONNECTION_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
});

try {
const result = await client.execute('SELECT * FROM audits');
return NextResponse.json({ message: 'Connected to database', data: result.rows });
} catch (error) {
console.error('Error connecting to database:', error);
return NextResponse.json({ message: 'Error connecting to database' }, { status: 500 });
} finally {
await client.close();
}
}
import { NextRequest, NextResponse } from 'next/server';
import { config } from "dotenv";
import { createClient } from '@libsql/client';

export const runtime = 'nodejs';

config({ path: ".env" });

export async function GET(req: NextRequest) {
const client = createClient({
url: process.env.TURSO_CONNECTION_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
});

try {
const result = await client.execute('SELECT * FROM audits');
return NextResponse.json({ message: 'Connected to database', data: result.rows });
} catch (error) {
console.error('Error connecting to database:', error);
return NextResponse.json({ message: 'Error connecting to database' }, { status: 500 });
} finally {
await client.close();
}
}
and it returns the updated data.
4 replies