Skip to content
Advertisement

Tag: postgresql

Nest JS Table is not creating. Written entities

Team, I have followed Nest.js and TypeORM documentations. Somehow tables are not generating in PostgreSQL. The database is connected successfully. Nest Server running without error. Issue: The table is not generating. src/tag/tag.entity.ts src/app.module.ts .local.env Please help me generate Postgres tables. Framework – Nest JS Database – PostgreSQL Answer Your username is mediumclone but the database you’re connecting to is postgres,

Getting A Month’s Worth of Data With KnexJS

I’m trying to get a month’s worth of data using KnexJS, I only have the year and month in the form 20xx-mm. Here’s my Knex query .. The issue is, I’m starting at a specific date and going through to the 31’st day, some months have 30 days, some 28 and 29. How do I go about to creating a

Cannot set headers after they are sent to the client bug with Express and node-postgres

I’m stuck with the issue of sending response back to the caller after retrieving something from Postgres database. It appears that headers are automatically written after fetchUserDB is executed (regardless of its success). This leads to the error ERR_HTTP_HEADERS_SENT when I try to return the response back using res.json() menthod. These are the headers after fetchUsedDB is called (just before

How to do an If await by the async function response

I’m trying to create a function that checks if a table already exists in the database and if it doesn’t, create one But the problem is the If doesn’t await for checkTableExist() Console Log Answer In checkTableExist you are checking your DB Query results using a callback function. In there, when you return, you are not actually returning to the

Problem with prisma .upsert, Unkown argument

I have problem with prisma upsert(), I get info: PrismaClientValidationError: Invalid prisma.prismaUser.upsert() invocation: { where: { email: ‘viola@prisma.io’ ~~~~~ }, update: { name: ‘Viola the Magnificent’ }, create: { email: ‘viola@prisma.io’, name: ‘Viola the Magnificent’, profileViews: 0, role: ‘admin’ } } Unknown arg email in where.email for type prismaUserWhereUniqueInput. Did you mean id? Available args: type prismaUserWhereUniqueInput { id? My

ERROR [ExceptionsHandler] Invalid `prisma.executeRaw()` invocation: ERROR [ExceptionsHandler] Invalid `prisma.executeRaw()` invocation:

my Stored procedure CREATE OR REPLACE PROCEDURE public.transfer_transactions( initiated_by integer, OUT transaction integer) LANGUAGE ‘plpgsql’ AS $BODY$ $BODY$; Calling the sp from nestjs prisma client async create(createTransactionDto: CreateTransactionDto) { const [callGetSequenceBlock, queryString] = await this.prisma.$transaction([ this.prisma.$executeRawCALL transfer_transactions(${login_id},@transaction);, this.prisma.$queryRawSELECT @transaction FROM DUAL;, ]); } error displayed while executing API Invalid prisma.executeRaw() invocation: Raw query failed. Code: 42703. Message: column “transaction_idout” does

Advertisement