All Questions
162 questions
0
votes
2
answers
435
views
TypeError: client.query is not a function
Hi I was trying to do a next js project and i got this error while trying to connect database.
I am using neon database.
app/provider.js
"use client";
import React, { useEffect } from "...
0
votes
2
answers
416
views
PSQL connection to Node.js issue
So I am able to connect to my psql database through the command prompt using the prompt (psql -h localhost -p 5432 -U postgres -d Luxe-Hotel) and putting in the password but I am unable to connect ...
0
votes
0
answers
64
views
How to Upsert Nested Relations in Prisma, using connectOrCreate? connectOrCreate doesn't update deeply nested relation
I'm working on an application using Prisma ORM with a schema that includes Profile, Contact, and SocialMedia models. I need to perform an update operation on a Profile, which should also handle ...
0
votes
0
answers
30
views
Correct way to access database when working with multiple JS files
JavaScript and PostgreSQL.
class User {
constructor(username, password, company_id, acclevel) {
this.username = username;
this.company_id = company_id;
this.acclevel = acclevel;
this....
0
votes
0
answers
26
views
Supabase (PostgreSQL) brain teaser
I have a 3 tables:
services - info about services (id, title)
city - info about city (id, city_name)
service_city - map multiple cities to services (service_id, city_id)
and I need functionality to ...
3
votes
1
answer
52
views
Program doesn't end after async function is called
I am just starting with postgresql.
I have successfully made connection with cloud database and retrieved data using nodejs 'postgres' package, but the program doesn't end after it logs all the data ...
0
votes
1
answer
483
views
connect strapi to postgresql on railway.app
would like to know, how I can connect my strapi project (that I have on my github and have deployed it on railway.app) with a PostgreSQL database that I also created on railway.app.
So far I have ...
-2
votes
1
answer
65
views
POST http://localhost:3000/serverSide 401 (Unauthorized) Error [duplicate]
I'm trying to send a username and password from an HTML file to a Javascript file that queries an employee table for that username and password. My problem is that the username and password are set to ...
4
votes
2
answers
755
views
Prisma Many to Many relationship with at least one value
I use Prisma and Postgresql for a project to store and manage recipes.
I am struggling to implement a Many to Many relationship where I can constrain one side to require at least one value for the ...
0
votes
1
answer
55
views
Unexpected behaviour in javascript async function with nested loops
I am creating a script to join multiple databases together.
It must check many variables like primary keys, data types etc..
I have an async function main that first of all gets the databases listed ...
0
votes
1
answer
349
views
Can I get a property instead of array of records using supabase select() in join table?
Take a look at the schema visualizer:
This is my request:
const { data } = await supabase.from('teams').select(`
*,
members:profiles (
*,
roles (
name
),
members(
...
0
votes
1
answer
40
views
How to call recursive when data connected each other in nodejs?
How to get node by node relation in between?
For an example, I want to search node A during node Z. For a while my data something like this?
I have data in DB such of this:
so on and so on.
This is ...
1
vote
2
answers
444
views
How to filter a prisma association to have only 1 association on a 1 to many
I have a DB with posts and tags. I want to find posts that only contain 1 tag with a specific tagId and no other tags at all. The code below works, but it requires the server to filter the results ...
0
votes
2
answers
415
views
How Can I Query User Via JSONB Data In Supabase?
This is a function that I wrote down to communicate with database and query admin users by a property that I call usertag which is unique for each user.
Idk why the function returns null, I mentioned ...
1
vote
0
answers
3k
views
"Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string"
When running my test, the following error appears:
`"after each" hook for "creates a new artist in the database"
Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a ...