Postgres Support

- Combines #4086 and #4087 PRs
- Adds authentik in CI stack
This commit is contained in:
Jamie Curnow
2024-12-24 08:57:54 +10:00
parent 805968aac6
commit ca3ee98c68
25 changed files with 647 additions and 67 deletions

View File

@ -1,4 +1,6 @@
const moment = require('moment');
const moment = require('moment');
const {isPostgres} = require('./config');
const {ref} = require('objection');
module.exports = {
@ -45,6 +47,16 @@ module.exports = {
}
});
return obj;
},
/**
* Casts a column to json if using postgres
*
* @param {string} colName
* @returns {string|Objection.ReferenceBuilder}
*/
castJsonIfNeed: function (colName) {
return isPostgres() ? ref(colName).castText() : colName;
}
};