Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
C
casbin-pg-adapter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abby Cin
casbin-pg-adapter
Commits
d7fa4f3e
Commit
d7fa4f3e
authored
May 11, 2020
by
DivyPatel9881
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: formatting.
parent
a9ba0421
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
adapter.go
adapter.go
+7
-4
No files found.
adapter.go
View file @
d7fa4f3e
...
@@ -242,7 +242,9 @@ func (a *Adapter) AddPolicies(sec string, ptype string, rules [][]string) error
...
@@ -242,7 +242,9 @@ func (a *Adapter) AddPolicies(sec string, ptype string, rules [][]string) error
}
}
err
:=
a
.
db
.
RunInTransaction
(
func
(
tx
*
pg
.
Tx
)
error
{
err
:=
a
.
db
.
RunInTransaction
(
func
(
tx
*
pg
.
Tx
)
error
{
_
,
err
:=
tx
.
Model
(
&
lines
)
.
OnConflict
(
"DO NOTHING"
)
.
Insert
()
_
,
err
:=
tx
.
Model
(
&
lines
)
.
OnConflict
(
"DO NOTHING"
)
.
Insert
()
return
err
return
err
})
})
...
@@ -265,7 +267,8 @@ func (a *Adapter) RemovePolicies(sec string, ptype string, rules [][]string) err
...
@@ -265,7 +267,8 @@ func (a *Adapter) RemovePolicies(sec string, ptype string, rules [][]string) err
}
}
err
:=
a
.
db
.
RunInTransaction
(
func
(
tx
*
pg
.
Tx
)
error
{
err
:=
a
.
db
.
RunInTransaction
(
func
(
tx
*
pg
.
Tx
)
error
{
_
,
err
:=
tx
.
Model
(
&
lines
)
.
Delete
()
_
,
err
:=
tx
.
Model
(
&
lines
)
.
Delete
()
return
err
return
err
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment