You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why on earth calling it with just isenabled and cssbubblestyles returns only the first value and null?
What's the best part - when I change the order to cssbubblestyles, isenabled, it returns correct values... Also, when I write just CSSBubbleStyles, or isenAbled, instead of lower case, it also works.
Any ideas?
Working code with pg library:
const result = await pool.query<ChatbotBubbleData>( SELECT isenabled, cssbubblestyles FROM Chatbots WHERE id = $1, [chatbotId] );
The text was updated successfully, but these errors were encountered:
This is my stackoverflow question:
https://stackoverflow.com/questions/79067775/sql-select-statement-returning-different-values-when-columns-in-different-order
but investigating this I found that it apparently is a bug because when changed vercel postgresql package to pg, the same query works.
Full problem:
I have a very weird SQL problem. I am creating next.js project and using vercel postgres sql. So when I call
const result = await sql
SELECT isenabled FROM Chatbots WHERE id = ${chatbotId};
;It returns { isenabled: true } as expected. When I do
SELECT isenabled, cssbubblestyles FROM Chatbots WHERE id = ${chatbotId};
it returns...
{ isenabled: true, cssbubblestyles: '' }
And that's incorrect, because in vercel I clearly see it has value. Also in pgAdmin 4.
When I do:
SELECT isenabled, cssbubblestyles, internalname FROM Chatbots WHERE id = ${chatbotId};
It returns correctly:
internalname: 'Chatbot' }
Why on earth calling it with just isenabled and cssbubblestyles returns only the first value and null?
What's the best part - when I change the order to cssbubblestyles, isenabled, it returns correct values... Also, when I write just CSSBubbleStyles, or isenAbled, instead of lower case, it also works.
Any ideas?
Working code with pg library:
const result = await pool.query<ChatbotBubbleData>(
SELECT isenabled, cssbubblestyles FROM Chatbots WHERE id = $1, [chatbotId] );
The text was updated successfully, but these errors were encountered: