Auth0 Home Blog Docs

Postgres connection in a rule and/or hooks?

rules
hooks

#1

Hello !

I’m trying to access our postgres database via a rule, but it seems like this is not supported?

When I try to copy/paste from the custom database connection template code, I get an error “postgres is not defined” in the code editor, though there are some templates for sqlserver.

I have the same issue with the hooks, which would be more appropriate as I need to do something after sign up.

Any advice ?


#2

You will need to require the modules that you need in your Rule. You can see a list of available modules here:
https://tehsis.github.io/webtaskio-canirequire/#

E.g.

var mysql = require('mysql@2.6.2');
.... rule code

#3