Setting up query
kjazer004
FREEOP

7 months ago

you can always get the DATABASE_PUBLIC_URL and use any postgres client like beekeper or the psql cli
can you elaborate on this please

$10 Bounty

56 Replies

kjazer004
FREEOP

7 months ago

@ThallesComH


passos
MODERATOR

7 months ago

do you have any postgres client?


kjazer004
FREEOP

7 months ago

i want to enable pgcrypto plugin, and make tales


kjazer004
FREEOP

7 months ago

no, doing all on vscode


kjazer004
FREEOP

7 months ago

do i need it?


passos
MODERATOR

7 months ago

as you already have the railway CLI, let's go with it but from now on I would recommend a postgres client like beekeper, dbeaver or even the psql cli


passos
MODERATOR

7 months ago

railway ssh


passos
MODERATOR

7 months ago

and then after the connection is established, type psql and hit enter


passos
MODERATOR

7 months ago

then just hit any query you want


kjazer004
FREEOP

7 months ago

service name as in, this? shuttle.proxy.rlwy.net ?


kjazer004
FREEOP

7 months ago

or full link


passos
MODERATOR

7 months ago

sorry, hit railway link first and then railway ssh


passos
MODERATOR

7 months ago

railway link will go through the setup


kjazer004
FREEOP

7 months ago

done


kjazer004
FREEOP

7 months ago

now i type whatever in there?


kjazer004
FREEOP

7 months ago

@ThallesComH


passos
MODERATOR

7 months ago

did you hit psql? can you send a screenshot


kjazer004
FREEOP

7 months ago

Project nurturing-peace linked successfully! 🎉 PS C:\Users\kemal\OneDrive\Documents\GitHub\cms\4_rail> npx railway ssh ✓ Connected to interactive shell root@a29cee42a4ba:/#


passos
MODERATOR

7 months ago

great then type psql and hit enter


kjazer004
FREEOP

7 months ago

done


passos
MODERATOR

7 months ago

now feel free to type any sql query, make sure to end it with ;


kjazer004
FREEOP

7 months ago

okay let me try to put random uuid plugin


kjazer004
FREEOP

7 months ago

railway=# alter table users; alter column user_id set default gen_random_uuid(); ERROR: syntax error at or near ";" LINE 1: alter table users; ^ ERROR: syntax error at or near "column" LINE 1: alter column user_id set default gen_random_uuid();


passos
MODERATOR

7 months ago

try a single command at a time


kjazer004
FREEOP

7 months ago

railway=# alter table users; ERROR: syntax error at or near ";" LINE 1: alter table users; ^ railway=# alter table users railway-# ; ERROR: syntax error at or near ";" LINE 2: ;


passos
MODERATOR

7 months ago

well the query itself is invalid, it should be like this:

alter table users alter column user_id set default gen_random_uuid();


kjazer004
FREEOP

7 months ago

odd, but it works, thank you


kjazer004
FREEOP

7 months ago

why cant i paste it tho


kjazer004
FREEOP

7 months ago

but i have to rewrite it all


passos
MODERATOR

7 months ago

wdym by can't paste and rewrite it all?


kjazer004
FREEOP

7 months ago

i have to write code, cant ctrl + v into cli


passos
MODERATOR

7 months ago

if you're on Windows, the CMD paste command is different


passos
MODERATOR

7 months ago

iirc it should be the right mouse button


kjazer004
FREEOP

7 months ago

it is


kjazer004
FREEOP

7 months ago

so odd


kjazer004
FREEOP

7 months ago

thank you tho


kjazer004
FREEOP

7 months ago

so i can put in that cli stuff like trigger functions and others?


passos
MODERATOR

7 months ago

yep


kjazer004
FREEOP

7 months ago

okay thanks, thats it i think


passos
MODERATOR

7 months ago

even tho I would recommend a sql viewer, a lot easier to manage


kjazer004
FREEOP

7 months ago

just installed dbeaver


passos
MODERATOR

7 months ago

what I use daily is beekeper as it has a better UI.
but I also keep dbeaver bcs beekeper can be limited in some actions.


kjazer004
FREEOP

7 months ago

can you tell me how can i use dbeaver for this please


passos
MODERATOR

7 months ago

it's easy, just add a connection and for credentials refer to your database variables tab


passos
MODERATOR

7 months ago

it's all through a GUI


passos
MODERATOR

7 months ago

if you've any questions lmk


kjazer004
FREEOP

7 months ago

i pasted URL and said invalid credentias


kjazer004
FREEOP

7 months ago

1389647231308665000


kjazer004
FREEOP

7 months ago

is all well?


passos
MODERATOR

7 months ago

you'll need to fill it out manually, dbeaver for some reason does not accept the DATABASE_URL


passos
MODERATOR

7 months ago

like select host and go from there


kjazer004
FREEOP

7 months ago

bruh, alr one sec


kjazer004
FREEOP

7 months ago

done


kjazer004
FREEOP

7 months ago

now, how can i do the cli thing again


kjazer004
FREEOP

7 months ago

i never used these tools, always done it through vscode


kjazer004
FREEOP

7 months ago

nevermind got it lol, thanks again


Loading...