Skip to content

Commit

Permalink
docs: add explanations on how to use an existing database in README (#46
Browse files Browse the repository at this point in the history
)

Add explanations on how to use an existing database
  • Loading branch information
evgeniy-dammer authored Feb 23, 2023
1 parent 5c834b8 commit 05fc180
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ func main() {
// Password: "...",
// })

// Or you can use an existing DB "abc" like this:
// The adapter will use the table named "casbin_rule".
// If it doesn't exist, the adapter will create it automatically.

// Or you can use an existing DB by adding a second string parameter with your database name to the NewAdapter(), like this:
// a, _ := pgadapter.NewAdapter("postgresql://username:password@postgres:5432/database?sslmode=disable", "your_database_name")

e := casbin.NewEnforcer("examples/rbac_model.conf", a)

// Load the policy from DB.
Expand Down

0 comments on commit 05fc180

Please sign in to comment.