-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from hackerchai/feature/sqlite
Feature/sqlite
- Loading branch information
Showing
8 changed files
with
499 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,8 +45,12 @@ jobs: | |
components: rustfmt, clippy | ||
override: true | ||
|
||
- name: Install PostgreSQL & MySQL Dependencies | ||
run: sudo apt-get install libpq-dev postgresql-client mysql-client libmysqlclient-dev | ||
- name: Install PostgreSQL & MySQL & SQLite Dependencies | ||
run: sudo apt-get install libpq-dev postgresql-client mysql-client libmysqlclient-dev libsqlite3-dev sqlite3 | ||
|
||
- name: Create SQLite DB | ||
run: | | ||
touch casbin.db | ||
- name: Create PostgresSQL Table | ||
run: psql postgres://casbin_rs:[email protected]:5432/casbin -c "CREATE TABLE IF NOT EXISTS casbin_rule ( | ||
|
@@ -76,6 +80,20 @@ jobs: | |
CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;" | ||
- name: Create SQLite Table | ||
run: | | ||
sqlite3 casbin.db -cmd "CREATE TABLE IF NOT EXISTS casbin_rule ( | ||
id INTEGER PRIMARY KEY, | ||
ptype VARCHAR(12) NOT NULL, | ||
v0 VARCHAR(128) NOT NULL, | ||
v1 VARCHAR(128) NOT NULL, | ||
v2 VARCHAR(128) NOT NULL, | ||
v3 VARCHAR(128) NOT NULL, | ||
v4 VARCHAR(128) NOT NULL, | ||
v5 VARCHAR(128) NOT NULL, | ||
CONSTRAINT unique_key_diesel_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5) | ||
);" | ||
- name: Cargo Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
|
@@ -185,6 +203,58 @@ jobs: | |
command: test | ||
args: --no-default-features --features mysql,runtime-actix-rustls | ||
|
||
#SQLite | ||
#async-std | ||
- name: Cargo Test For SQLite,runtime-async-std-native-tls | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
DATABASE_URL: sqlite:casbin.db | ||
with: | ||
command: test | ||
args: --no-default-features --features sqlite,runtime-async-std-native-tls | ||
|
||
- name: Cargo Test For SQLite,runtime-async-std-rustls | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
DATABASE_URL: sqlite:casbin.db | ||
with: | ||
command: test | ||
args: --no-default-features --features sqlite,runtime-async-std-rustls | ||
|
||
# tokio | ||
- name: Cargo Test For SQLite,runtime-tokio-native-tls | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
DATABASE_URL: sqlite:casbin.db | ||
with: | ||
command: test | ||
args: --no-default-features --features sqlite,runtime-tokio-native-tls | ||
|
||
- name: Cargo Test For SQLite,runtime-tokio-rustls | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
DATABASE_URL: sqlite:casbin.db | ||
with: | ||
command: test | ||
args: --no-default-features --features sqlite,runtime-tokio-rustls | ||
|
||
# actix | ||
- name: Cargo Test For SQLite,runtime-actix-native-tls | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
DATABASE_URL: sqlite:casbin.db | ||
with: | ||
command: test | ||
args: --no-default-features --features sqlite,runtime-actix-native-tls | ||
|
||
- name: Cargo Test For SQLite,runtime-actix-rustls | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
DATABASE_URL: sqlite:casbin.db | ||
with: | ||
command: test | ||
args: --no-default-features --features sqlite,runtime-actix-rustls | ||
|
||
- name: Cargo Clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
.idea/ | ||
Cargo.lock | ||
.DS_Store | ||
*.db | ||
*.db-wal | ||
*.db-shm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "sqlx-adapter" | ||
version = "0.4.0" | ||
version = "0.4.1" | ||
authors = ["Eason Chai <[email protected]>","Cheng JIANG <[email protected]>"] | ||
edition = "2018" | ||
license = "Apache-2.0" | ||
|
@@ -23,6 +23,7 @@ default = ["postgres", "runtime-tokio-native-tls", "offline"] | |
#databases | ||
postgres = ["sqlx/postgres"] | ||
mysql = ["sqlx/mysql"] | ||
sqlite = ["sqlx/sqlite"] | ||
|
||
# async runtime | ||
# async-std | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.