backend-plus 2.5.0-betha.2 → 2.5.0-betha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -789,9 +789,6 @@ AppBackend.prototype.start = function start(opts){
789
789
  ):'!app local internal';
790
790
  return client.executeSentences([
791
791
  "SET application_name = "+be.db.quoteLiteral(dbAppName),
792
- ...(username ? [
793
- `SELECT set_app_user(${be.db.quoteLiteral(username)})`
794
- ] : [])
795
792
  ]).then(function(){
796
793
  var search_path = be.config.db.search_path;
797
794
  if(search_path.length>0){
@@ -801,6 +798,14 @@ AppBackend.prototype.start = function start(opts){
801
798
  }else{
802
799
  return client;
803
800
  }
801
+ }).then(function(client){
802
+ if(username){
803
+ return client.query(`SELECT set_app_user(${be.db.quoteLiteral(username)})`).execute().then(function(){
804
+ return client;
805
+ });
806
+ }else{
807
+ return client;
808
+ }
804
809
  }).then(function(client){
805
810
  if(be.config["client-setup"].lang=='es'){
806
811
  return client.query("set datestyle TO iso,dmy").execute().then(function(){
@@ -2932,7 +2937,7 @@ AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(pa
2932
2937
  }
2933
2938
  lines.push(`
2934
2939
  create or replace function set_app_user(p_user text) returns text
2935
- volatile language plpgsql
2940
+ secirotu definer volatile language plpgsql
2936
2941
  as
2937
2942
  $body$
2938
2943
  declare
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backend-plus",
3
3
  "description": "Backend for the anti Pareto rule",
4
- "version": "2.5.0-betha.2",
4
+ "version": "2.5.0-betha.3",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",
@@ -82,7 +82,7 @@
82
82
  "@types/js-yaml": "^4.0.9",
83
83
  "@types/mocha": "^10.0.10",
84
84
  "@types/multiparty": "~4.2.1",
85
- "@types/node": "^22.15.21",
85
+ "@types/node": "^22.15.29",
86
86
  "@types/nodemailer": "^6.4.17",
87
87
  "@types/numeral": "~2.0.5",
88
88
  "@types/session-file-store": "^1.2.5",