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
hello
it looks like CTE (.With) doesn't generate proper sql query
I have following sql:
WITH ins
AS ( INSERT INTO profile_source_on_chain (address, nick_name) VALUES ('0x72c9fb7ed19d3ce51cea5c56b3e023cd918baadf3', 'Sei Ape Club') ON CONFLICT (address, nick_name) DO NOTHING RETURNING id)
SELECT id
FROM ins
UNION ALL
SELECT id
FROM profile_source_on_chain
WHERE address = '0x72c9fb7ed19d3ce51cea5c56b3e023cd918baadf3'
and nick_name = 'Sei Ape Club';
`
and i need to use bun to create same sql.
ProfileSourceOnChain is table with 3 columns: id (uuid), address , nickname varchar
Have constraint (address , nickname)
(WITH ins
AS ( INSERT INTO profile_source_on_chain (address, nick_name) VALUES ('0x72c9fb7ed19d3ce51cea5c56b3e023cd918baadf3', 'Sei Ape Club') ON CONFLICT (address, nick_name) DO NOTHING RETURNING id)
SELECT id
FROM ins)
UNION ALL
SELECT id
FROM profile_source_on_chain
WHERE address = '0x72c9fb7ed19d3ce51cea5c56b3e023cd918baadf3'
and nick_name = 'Sei Ape Club';
the issue with brackets at the beginning and after FROM ins.
Execution of the sql gives an error:
ERROR: WITH clause containing a data-modifying statement must be at the top level
Need help with fixing this issue. thanks
The text was updated successfully, but these errors were encountered:
hello
it looks like CTE (.With) doesn't generate proper sql query
I have following sql:
and i need to use bun to create same sql.
ProfileSourceOnChain is table with 3 columns: id (uuid), address , nickname varchar
Have constraint (address , nickname)
`
onChain := ProfileSourceOnChain{Address: "address",NickName:"nickname"}
the above code will generate
the issue with brackets at the beginning and after FROM ins.
Execution of the sql gives an error:
Need help with fixing this issue. thanks
The text was updated successfully, but these errors were encountered: