Skip to content
session
jasonandyquan
OP

2 years ago

I'm struggling to create the session table, the one used by passport-local's pgsession, in railway's postgres database. For more info, I used the provided query from pg connect docs:

`CREATE TABLE "session" (

"sid" varchar NOT NULL COLLATE "default",

"sess" json NOT NULL,

"expire" timestamp(6) NOT NULL

)

WITH (OIDS=FALSE);

ALTER TABLE "session" ADD CONSTRAINT "session_pkey" PRIMARY KEY ("sid") NOT DEFERRABLE INITIALLY IMMEDIATE;

CREATE INDEX "IDX_session_expire" ON "session" ("expire");`

Does anybody know how to create this table with railway's table view, or is there some sort of way to query it?

Solved

10 Replies

jasonandyquan
OP

2 years ago

N/A


maddsua

2 years ago

Hey, what problem are you experiencing exactly?


maddsua

2 years ago

Okay after reading it one more time I would simply recommend you to use the psql tool to do that


maddsua

2 years ago

You would need to follow these steps:

  1. Install psql on your system
  2. Copy database public url from service environment tab
  3. Connect to the database with psql using the public url
  4. Copy and paste that create table query and press enter

maddsua

2 years ago

Unfortunately the data tab has very limited functionality, and doesn't support advanced operations such as setting up constraints


jasonandyquan
OP

2 years ago

Got it, thanks man


jasonandyquan
OP

2 years ago

I was confused and spent alot of time trying to search for the raw sql query option 💀


jasonandyquan
OP

2 years ago

because of this changelog i stumbled upon: https://railway.com/changelog/2021-10-22#raw-sql-queries


maddsua

2 years ago

ye lol they have removed it some time in the past


2 years ago

!s


Status changed to Solved brody • almost 2 years ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...