Closed azmi-plavaga closed 1 week ago
@nodece @Shivansh-yadav13
@azmi-plavaga this is because the code below uses promises to insert each rule, so it doesn't keep the order. But if we don't use async promises, it will be very slow to insert one by one in the sync way. So I suggest we change it to batch insert like how we did in other adapters. So just one batch insert to insert all rules, fast and keep order.
Order of policies in DB after savePolicy is not same as in source file: examples/rbac_policy.csv
Sample test: https://github.com/node-casbin/prisma-adapter/blob/master/test/adapter.test.ts Code snippet: line 40-50