I have a module that handles database pool creation. I created an export function to expose database pool for other fivem modules.
exports('getPool', () => {
return pool;
});
Now I can access this pool from other resources, however this object has a method getConnection(), which returns connection via a JavaScript Promise API. When I call this method an empty object is returned to me in code.
const dbPool = exports["my-resource"].getPool(); // Object.keys(dbPool) has all functions
const conn = await dbPool.getConnection(); // <-- will be completely unrelated object where Object.keys(conn) === []
Of course it works when I will duplicate pool code in this resource, but this will cause a problem of having multiple database pools in runtime.
Maybe somebody has encountered similar problem and can help me.
I did look at gitlab-ci and âbuild_server_proot.shâ script, but there are some env variables like FIVEM_PRIVATE_URI, which I donât seem to find any documentation on. Plan was to quickly spin up CI process and start testing the changes.
Unless, there is a better way to do it, which I havenât found.
No idea itâs not my pull request. I forked the repo in 2020 and tried modifying the engine (through trial & error) to support async & Promise, but I never got it working. My fork can be found here Commits ¡ bound2/fivem ¡ GitHub