PGSQL schema and sessions

ref: Wappler 5.2.0 Released

how does the PGSQL schema support really works?

i have connected PG DB instance where schema name is ‘abc’.

unless i manully edit the JSON file for DB connection with "searchPath":["abc"] i will get following error:
(node:33754) UnhandledPromiseRejectionWarning: error: create table "sessions" ("sid" varchar(255), "sess" json not null, "expired" timestamptz not null) - no schema has been selected to create in

how to choose the schema?

found this as well. but no clue on how this fix really works!

am on wappler 5.2.3 btw and experimental mode is on.

Where is your default public schema?

It is there in the same DB cannot delete or rename
We’re using digital ocean managed hosting. Default schema cannot be edited or removed.

We ar enot using it at all. All out tables are in a different schema under this DB.

Could you include the generated server connect action json file?

Maybe try creating a simple query, see if that works.

And indeed make sure you have the experimental options on.

The error you get is from the session middleware, it can’t find/create the session table.

Create a user_config.json in your app/config folder. Prefix the tablename with the schema.

{
  "session": {
    "store": {
      "tablename": "abc.sessions"
    }
  }
}

thanks. that helped.

but now i cannot logout, it just keeps me logged in even if am doing a ‘security logout’ via api.

and also, there is still this error:

(node:37430) UnhandledPromiseRejectionWarning: error: create table "app"."sessions" ("sid" varchar(255), "sess" json not null, "expired" timestamptz not null) - relation "sessions" already exists

In the next Wappler update we will have a new option for Postgres Database Connection to specify Search path for your schemas. So there you can specify you own default schema if you are not using public.

Fixed in Wappler 5.2.4

1 Like

This topic was automatically closed after 47 hours. New replies are no longer allowed.