Sequelize adapter not recognising ssl option when using postgres uri
apsnaidu opened this issue · 2 comments
apsnaidu commented
When using a postgres URI for creating a new sequelize adapter I'm getting SSL connection is required. Please specify SSL options and retry.
.
Below is the syntax I'm using.
const { SequelizeAdapter } = require("casbin-sequelize-adapter");
sqladapter = await SequelizeAdapter.newAdapter(postgres://root@localhost:5432/testdb, {
dialect: "postgres",
schema: "automation",
dialectOptions: {
ssl: true,
},
});
The adapter works fine when using username, password syntax.
sqladapter = await SequelizeAdapter.newAdapter({
host: "hostname",
port: "5432",
username: "root",
password: "",
database: "testdb",
dialect: "postgres",
schema: "automation",
dialectOptions: {
ssl: true,
},
});
"sequelize": "^5.22.3"
"casbin-sequelize-adapter": "^2.1.0"
"casbin": "^5.1.3"
zhmushan commented
sequelize-adapter/src/adapter.ts
Lines 30 to 36 in af6d3b8
newAdapter
only allows SequelizeOptions
instead of string
hsluoyz commented
@zhmushan we also need to update the README: https://github.com/node-casbin/sequelize-adapter#simple-example
/cc @nodece