skip to Main Content

Data not getting inserted into database, despite of 201 request status – postgresql express js

I am using Typescript, Express, PostgresDB. Here is my code for connecting to the database cluster. import { Pool } from "pg"; const myPool = new Pool({ host: `${process.env.DATABASE_URL}`, //somedb.abc.us-east-1.rds.amazonaws.com database: `${process.env.DATABASE_NAME}`, //dbName user: `${process.env.DATABASE_USER}`, //dbUser password: `${process.env.DATABASE_PASSWORD}`, //dbPassword port:…

VIEW QUESTION

Null instead of null values in jsonb_build_object – Postgresql

I am trying to build query that gets data from 3 different tables using sqlalchemy I tried select( models.Animals.id, models.Animals.description, models.AnimalTypes.name.label('type'), func.coalesce( func.array_agg( func.jsonb_build_object( 'id', models.Animals.id ) ), None ).label('animals') ) .join(models.FamilyTypes, models.Family.id == models.Family.family_type_id) .outerjoin(models.Animals, models.Animals.campaign_id == models.Animals.id) .group_by(models.Family.id,…

VIEW QUESTION
Back To Top
Search