Skip to content

Commit

Permalink
docs: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz authored Nov 28, 2023
1 parent 26edd2d commit 82997d6
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Sqlx Adapter is the [Sqlx](https://github.com/launchbadge/sqlx) adapter for [Cas

Based on [Sqlx](https://github.com/launchbadge/sqlx), The current supported databases are:

- [Mysql](https://www.mysql.com/)
- [Postgres](https://github.com/lib/pq)
- [MySQL](https://www.mysql.com/)
- [PostgreSQL](https://github.com/lib/pq)
- [SQLite](https://www.sqlite.org)

## Notice
Expand All @@ -24,12 +24,26 @@ ALTER TABLE casbin_rules RENAME TO casbin_rule;

## Install

Add it to `Cargo.toml`
Add the following to `Cargo.toml`:

For MySQL:

```toml
sqlx-adapter = { version = "0.4.2, default-features = false, features = ["mysql", "runtime-tokio-native-tls"]}
tokio = { version = "1.1.1", features = ["macros"] }
```

For PostgreSQL:

```toml
sqlx-adapter = { version = "0.4.2", default-features = false, features = ["postgres", "runtime-tokio-native-tls"]}
# sqlx-adapter = { version = "0.4.2, default-features = false, features = ["mysql", "runtime-tokio-native-tls"]}
# sqlx-adapter = { version = "0.4.2, default-features = false, features = ["sqlite", "runtime-tokio-native-tls"]}
tokio = { version = "1.1.1", features = ["macros"] }
```

For SQLite:

```toml
sqlx-adapter = { version = "0.4.2, default-features = false, features = ["sqlite", "runtime-tokio-native-tls"]}
tokio = { version = "1.1.1", features = ["macros"] }
```

Expand Down Expand Up @@ -185,4 +199,4 @@ async fn main() -> Result<()> {
- `mysql`
- `sqlite`

*Attention*: `postgres`, `mysql`, `sqlite` are mutual exclusive which means that you can only activate one of them.
*Attention*: `postgres`, `mysql`, `sqlite` are mutual exclusive which means that you can only activate one of them.

0 comments on commit 82997d6

Please sign in to comment.