See Casnode in production: Casbin Forum, with hundreds of real questions about Casbin, Casdoor, OpenAgent and Casvisor. Visit →

I started with the default SQLite file to test. For the real thing I want PostgreSQL 16. What do I change, and do I have to create the tables myself?

9views
2users
1 minread

Put this in conf/app.local.conf:

driverName = postgres
dataSourceName = user=casnode password=secret host=localhost port=5432 sslmode=disable
dbName = casnode

On the first start Casnode creates the database if it's missing, then the tables. For MySQL it's driverName = mysql with dataSourceName = casnode:secret@tcp(localhost:3306)/, and mssql works for SQL Server.

Casnode doesn't move the data of the SQLite file into the new database, so either start fresh or copy it over with your own tools.

Done, the tables showed up on the first start. For anyone else: the database role needs CREATEDB, or create the database yourself beforehand.

1 / 3
Oct 27