Skip to content

Commit

Permalink
docs: add sqlite support and turn off AutoMigrate description (#161)
Browse files Browse the repository at this point in the history
Signed-off-by: tangyang9464 <tangyang9464@163.com>
  • Loading branch information
tangyang9464 authored May 12, 2022
1 parent 956618a commit 6248ffe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Based on [Officially Supported Databases](https://v1.gorm.io/docs/connecting_to_
- PostgreSQL
- SQL Server
- Sqlite3
> Since `` sqlite`` needs ``cgo`` support, it is only supported in branch ``sqlite`` instead of ``master``.See detail: [gorm-adapter#93](https://github.com/casbin/gorm-adapter/issues/93). If you want to use it, maybe you need to merge ``sqlite`` to ``master`` branch manually
> gorm-adapter use ``github.com/glebarez/sqlite`` instead of gorm official sqlite driver ``gorm.io/driver/sqlite`` because the latter needs ``cgo`` support. But there is almost no difference between the two driver. If there is a difference in use, please submit an issue.
You may find other 3rd-party supported DBs in Gorm website or other places.
- other 3rd-party supported DBs in Gorm website or other places.

## Installation

Expand Down Expand Up @@ -69,7 +69,8 @@ func main() {
e.SavePolicy()
}
```

## Turn off AutoMigrate
New an adapter will use ``AutoMigrate`` by default for create table, if you want to turn it off, please use API ``NewAdapterWithoutAutoMigrate(db *gorm.DB) (*Adapter, error)``. Find out more at [gorm-adapter#160](https://github.com/casbin/gorm-adapter/pull/160)
## Customize table columns example
You can change the gorm struct tags, but the table structure must stay the same.
```go
Expand Down

0 comments on commit 6248ffe

Please sign in to comment.