Setting up query
kjazer004
FREEOP

a year 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

a year ago

@ThallesComH


a year ago

do you have any postgres client?


kjazer004
FREEOP

a year ago

i want to enable pgcrypto plugin, and make tales


kjazer004
FREEOP

a year ago

no, doing all on vscode


kjazer004
FREEOP

a year ago

do i need it?


a year 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


a year ago

railway ssh


a year ago

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


a year ago

then just hit any query you want


kjazer004
FREEOP

a year ago

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


kjazer004
FREEOP

a year ago

or full link


a year ago

sorry, hit railway link first and then railway ssh


a year ago

railway link will go through the setup


kjazer004
FREEOP

a year ago

done


kjazer004
FREEOP

a year ago

now i type whatever in there?


kjazer004
FREEOP

a year ago

@ThallesComH


a year ago

did you hit psql? can you send a screenshot


kjazer004
FREEOP

a year ago

PS C:\Users\kemal\OneDrive\Documents\GitHub\cms\4_rail> npx railway ssh
  ✓ Connected to interactive shell                                       root@a29cee42a4ba:/#   

a year ago

great then type psql and hit enter


kjazer004
FREEOP

a year ago

done


a year ago

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


kjazer004
FREEOP

a year ago

okay let me try to put random uuid plugin


kjazer004
FREEOP

a year ago

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();```


a year ago

try a single command at a time


kjazer004
FREEOP

a year ago

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


a year 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

a year ago

odd, but it works, thank you


kjazer004
FREEOP

a year ago

why cant i paste it tho


kjazer004
FREEOP

a year ago

but i have to rewrite it all


a year ago

wdym by can't paste and rewrite it all?


kjazer004
FREEOP

a year ago

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


a year ago

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


a year ago

iirc it should be the right mouse button


kjazer004
FREEOP

a year ago

it is


kjazer004
FREEOP

a year ago

so odd


kjazer004
FREEOP

a year ago

thank you tho


kjazer004
FREEOP

a year ago

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


a year ago

yep


kjazer004
FREEOP

a year ago

okay thanks, thats it i think


a year ago

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


kjazer004
FREEOP

a year ago

just installed dbeaver


a year 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

a year ago

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


a year ago

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


a year ago

it's all through a GUI


a year ago

if you've any questions lmk


kjazer004
FREEOP

a year ago

i pasted URL and said invalid credentias


kjazer004
FREEOP

a year ago

1389647231308665034


kjazer004
FREEOP

a year ago

is all well?


a year ago

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


a year ago

like select host and go from there


kjazer004
FREEOP

a year ago

bruh, alr one sec


kjazer004
FREEOP

a year ago

done


kjazer004
FREEOP

a year ago

now, how can i do the cli thing again


kjazer004
FREEOP

a year ago

i never used these tools, always done it through vscode


kjazer004
FREEOP

a year ago

nevermind got it lol, thanks again


Welcome!

Sign in to your Railway account to join the conversation.

Loading...