Skip to content

Tag: postgresql

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: ‘’ ~~~~~ }, update: { name: ‘Viola the Magnificent’ }, create: { email: ‘’, name: ‘Viola the Magnificent’, profileViews: 0, role: ‘admin’ } } Unknown arg email in 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

Knex migration failed with error: The query is empty

I updated knex from 0.21 to 0.95 following their migration guide, Now im geting this Error on CI when its running npx knex migrate:latest but the migration file contains the query’s Any help would be greatly appreciated as im getting no where with the error message Answer So i was getting this error since Knex 0.95 introduced a new feature