nshkrsh
November 14, 2022, 6:32pm
1
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?
nshkrsh
November 14, 2022, 6:39pm
2
Yes.
Turns out, I had not changed the code in TARGET specific db.json file.
After doing that, this issue of having to keep discarding changes was gone.
The original issue of not having an option to select schema in the UI is still pending.
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.
George
November 14, 2022, 11:16pm
3
Where is your default public schema?
nshkrsh
November 15, 2022, 2:12am
4
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.
George
November 15, 2022, 7:42am
5
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.
patrick
November 15, 2022, 11:06am
7
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"
}
}
}
nshkrsh
November 15, 2022, 4:55pm
8
thanks. that helped.
but now i cannot logout, it just keeps me logged in even if am doing a ‘security logout’ via api.
nshkrsh
November 15, 2022, 4:55pm
9
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
George
November 16, 2022, 11:17am
10
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.
Teodor
Closed
November 19, 2022, 4:00pm
14
This topic was automatically closed after 47 hours. New replies are no longer allowed.