From c5153272445a5e23b726d0be2fb40d8cd3385a99 Mon Sep 17 00:00:00 2001 From: kisuke Date: Fri, 26 Jun 2026 12:26:36 +0500 Subject: [PATCH 1/2] nixed and upgrade pkgs of sqlx --- .editorconfig | 27 +++++++++++++++++++++++ .envrc | 1 + .gitignore | 5 ++++- Cargo.toml | 16 +++++++------- bleur.toml | 2 ++ flake.lock | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 41 ++++++++++++++++++++++++++++++++++ shell.nix | 36 ++++++++++++++++++++++++++++++ 8 files changed, 180 insertions(+), 9 deletions(-) create mode 100644 .editorconfig create mode 100644 .envrc create mode 100644 bleur.toml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 shell.nix diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6dd8dc9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,27 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 + +[*.rs] +indent_style = space +indent_size = 4 + +[*.{yml,yaml}] +# YAML files usually prefer 2 spaces +indent_size = 2 + +[*.{json,toml}] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab +indent_size = 8 diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 0b2fe33..344788d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,7 @@ Cargo.lock # Ignore sqlite DB files *.db *.db-wal -*.db-shm \ No newline at end of file +*.db-shm + +/.direnv/ +/result* \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index b4451e9..11224fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,8 @@ homepage= "https://github.com/casbin-rs/sqlx-adapter" readme= "README.md" [dependencies] -casbin = { version = "2.1.0", default-features = false } -sqlx = { version = "0.8", default-features = false, features = [ "macros" ] } +casbin = { version = "2.20.0", default-features = false } +sqlx = { version = "0.9", default-features = false, features = [ "macros" ,"runtime-async-std","tls-native-tls" ] } async-trait = "0.1.51" dotenvy = { version = "0.15.0", default-features = false } tokio = { version = "1.10.0", default-features = false, optional = true } @@ -26,16 +26,16 @@ sqlite = ["sqlx/sqlite"] # async runtime # async-std -runtime-async-std-native-tls = ["casbin/runtime-async-std", "sqlx/runtime-async-std-native-tls"] -runtime-async-std-rustls = ["casbin/runtime-async-std", "sqlx/runtime-async-std-rustls"] +runtime-async-std-native-tls = ["casbin/runtime-async-std", "sqlx/runtime-async-std"] +runtime-async-std-rustls = ["casbin/runtime-async-std", "sqlx/tls-rustls"] # tokio runtime-tokio = ["casbin/runtime-tokio", "sqlx/runtime-tokio"] -runtime-tokio-native-tls = ["casbin/runtime-tokio", "sqlx/runtime-tokio-native-tls"] -runtime-tokio-rustls = ["casbin/runtime-tokio", "sqlx/runtime-tokio-rustls"] +runtime-tokio-native-tls = ["casbin/runtime-tokio", "sqlx/tls-native-tls"] +runtime-tokio-rustls = ["casbin/runtime-tokio", "sqlx/tls-native-tls"] [dev-dependencies] -async-std = { version = "1.9.0", features = [ "attributes" ] } -tokio = { version = "1.10.0", features = [ "full" ] } +async-std = { version = "1.13.2", features = [ "attributes" ] } +tokio = { version = "1.52.3", features = [ "full" ] } [profile.release] codegen-units = 1 diff --git a/bleur.toml b/bleur.toml new file mode 100644 index 0000000..cd92a14 --- /dev/null +++ b/bleur.toml @@ -0,0 +1,2 @@ +[project] +name = "sqlx-adapter" diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..27372ac --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1778716662, + "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1781577229, + "narHash": "sha256-lrp67w8AulE9Ks53n27I45ADSzbOCn4H+CNW1Ck8B+8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "567a49d1913ce81ac6e9582e3553dd90a955875f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1777168982, + "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6c43c2d --- /dev/null +++ b/flake.nix @@ -0,0 +1,41 @@ +{ + description = "A beginning of an awesome project bootstrapped with bleur/templates"; + + inputs = { + # Stable for keeping thins clean + # nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + + # Fresh and new for testing + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + # The flake-parts library + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = + { + self, + flake-parts, + ... + }@inputs: + flake-parts.lib.mkFlake { inherit inputs; } ( + { ... }: + { + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + perSystem = + { pkgs, ... }: + { + # Nix script formatter + formatter = pkgs.alejandra; + + # Development environment + devShells.default = import ./shell.nix self { inherit pkgs; }; + }; + } + ); +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..916506d --- /dev/null +++ b/shell.nix @@ -0,0 +1,36 @@ +flake: +{ pkgs, ... }: +let + # Hostplatform system + system = pkgs.hostPlatform.system; +in +pkgs.mkShell { + packages = with pkgs; [ + nixd + statix + deadnix + alejandra + + rustfmt + clippy + rust-analyzer + cargo-watch + + # Other packages here + openssl + pkg-config + libressl + curl + # ... + stdenv + gcc + rustc + ]; + + # RUST_BACKTRACE = "full"; + # RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; + + shellHook = '' + # Extra steps to do while activating development shell + ''; +} From eac7a0201a79651f01c1701f54334ec50e2a48d6 Mon Sep 17 00:00:00 2001 From: kisuke Date: Fri, 26 Jun 2026 12:49:53 +0500 Subject: [PATCH 2/2] prepared new statements --- ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 12 +-- ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 ---- ...36247a328db780a48da47c9402e1d3ebd80c9.json | 4 +- ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 ---- ...4d087d2be1af041834137a2d88d2e35e55a6e.json | 12 +++ ...e78f2a23eff67925322bdd3646d063d710584.json | 84 ++++++++++++---- ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 4 +- ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 --- ...b89853785c32a5f83cb0b25609329c760428a.json | 19 ---- ...faae78671d69c8935d2a2d57c0f9d1e91e832.json | 97 +++++++++++++------ ...dde4cdf8b9510ed4f6170db482ab4373b30a1.json | 12 +++ ...e05246b9aa3b2ac15b40c75a572a27985d1b7.json | 12 +++ ...4b70295c22468126e4aff4a5ea09166aa89e6.json | 12 +++ ...3b648636a2b394df7deec3253d5fc8bacdde1.json | 12 +++ ...525236e8ca6451b3b3f9b803d63cdba952cf8.json | 12 +++ ...7eed460ca39ffb72076a3b8445c42ee21e00.json} | 11 +-- ...226ba97993ede9988a4c57d58bd066500a119.json | 20 ---- ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 ---- shell.nix | 1 + 19 files changed, 215 insertions(+), 180 deletions(-) delete mode 100644 .sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json delete mode 100644 .sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json create mode 100644 .sqlx/query-36ad74d145318f6da577834578f4d087d2be1af041834137a2d88d2e35e55a6e.json delete mode 100644 .sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json delete mode 100644 .sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json create mode 100644 .sqlx/query-5c221dea5dbeb61d1fa6881874adde4cdf8b9510ed4f6170db482ab4373b30a1.json create mode 100644 .sqlx/query-5e197eb50652dbbfd14df29b60ae05246b9aa3b2ac15b40c75a572a27985d1b7.json create mode 100644 .sqlx/query-691960c016861fbb27f123f9a4e4b70295c22468126e4aff4a5ea09166aa89e6.json create mode 100644 .sqlx/query-7067873f4ca887bf691a3b92a723b648636a2b394df7deec3253d5fc8bacdde1.json create mode 100644 .sqlx/query-87fa46998bdfaeab2400a20493f525236e8ca6451b3b3f9b803d63cdba952cf8.json rename .sqlx/{query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json => query-dc8abb55cf0b35edab2a568a287c7eed460ca39ffb72076a3b8445c42ee21e00.json} (55%) delete mode 100644 .sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json delete mode 100644 .sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json diff --git a/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json index eb3a84f..a03b8e7 100644 --- a/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json +++ b/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json @@ -1,18 +1,10 @@ { - "db_name": "PostgreSQL", + "db_name": "SQLite", "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", "describe": { "columns": [], "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] + "Right": 7 }, "nullable": [] }, diff --git a/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json deleted file mode 100644 index 1ea12e3..0000000 --- a/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" -} diff --git a/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json index 8046c5d..1d60420 100644 --- a/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json +++ b/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json @@ -1,10 +1,10 @@ { - "db_name": "PostgreSQL", + "db_name": "SQLite", "query": "DELETE FROM casbin_rule", "describe": { "columns": [], "parameters": { - "Left": [] + "Right": 0 }, "nullable": [] }, diff --git a/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json deleted file mode 100644 index e246e53..0000000 --- a/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" -} diff --git a/.sqlx/query-36ad74d145318f6da577834578f4d087d2be1af041834137a2d88d2e35e55a6e.json b/.sqlx/query-36ad74d145318f6da577834578f4d087d2be1af041834137a2d88d2e35e55a6e.json new file mode 100644 index 0000000..0a33246 --- /dev/null +++ b/.sqlx/query-36ad74d145318f6da577834578f4d087d2be1af041834137a2d88d2e35e55a6e.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM casbin_rule WHERE\n ptype = ?1 AND\n (v2 is NULL OR v2 = COALESCE(?2,v2)) AND\n (v3 is NULL OR v3 = COALESCE(?3,v3)) AND\n (v4 is NULL OR v4 = COALESCE(?4,v4)) AND\n (v5 is NULL OR v5 = COALESCE(?5,v5))", + "describe": { + "columns": [], + "parameters": { + "Right": 5 + }, + "nullable": [] + }, + "hash": "36ad74d145318f6da577834578f4d087d2be1af041834137a2d88d2e35e55a6e" +} diff --git a/.sqlx/query-3ae7e28de7cb8896086c186dbc0e78f2a23eff67925322bdd3646d063d710584.json b/.sqlx/query-3ae7e28de7cb8896086c186dbc0e78f2a23eff67925322bdd3646d063d710584.json index 6f82475..f2973a7 100644 --- a/.sqlx/query-3ae7e28de7cb8896086c186dbc0e78f2a23eff67925322bdd3646d063d710584.json +++ b/.sqlx/query-3ae7e28de7cb8896086c186dbc0e78f2a23eff67925322bdd3646d063d710584.json @@ -1,51 +1,99 @@ { - "db_name": "PostgreSQL", + "db_name": "SQLite", "query": "SELECT id, ptype, v0, v1, v2, v3, v4, v5 FROM casbin_rule", "describe": { "columns": [ { - "ordinal": 0, "name": "id", - "type_info": "Int4" + "ordinal": 0, + "type_info": "Integer", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "id" + } + } }, { - "ordinal": 1, "name": "ptype", - "type_info": "Varchar" + "ordinal": 1, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "ptype" + } + } }, { - "ordinal": 2, "name": "v0", - "type_info": "Varchar" + "ordinal": 2, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v0" + } + } }, { - "ordinal": 3, "name": "v1", - "type_info": "Varchar" + "ordinal": 3, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v1" + } + } }, { - "ordinal": 4, "name": "v2", - "type_info": "Varchar" + "ordinal": 4, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v2" + } + } }, { - "ordinal": 5, "name": "v3", - "type_info": "Varchar" + "ordinal": 5, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v3" + } + } }, { - "ordinal": 6, "name": "v4", - "type_info": "Varchar" + "ordinal": 6, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v4" + } + } }, { - "ordinal": 7, "name": "v5", - "type_info": "Varchar" + "ordinal": 7, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v5" + } + } } ], "parameters": { - "Left": [] + "Right": 0 }, "nullable": [ false, diff --git a/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json index 75c6da3..19e62d5 100644 --- a/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json +++ b/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json @@ -1,10 +1,10 @@ { - "db_name": "PostgreSQL", + "db_name": "SQLite", "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", "describe": { "columns": [], "parameters": { - "Left": [] + "Right": 0 }, "nullable": [] }, diff --git a/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json deleted file mode 100644 index ce229dc..0000000 --- a/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" -} diff --git a/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json deleted file mode 100644 index 4c4c1df..0000000 --- a/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" -} diff --git a/.sqlx/query-530d3f59ba6d986d3354242ff25faae78671d69c8935d2a2d57c0f9d1e91e832.json b/.sqlx/query-530d3f59ba6d986d3354242ff25faae78671d69c8935d2a2d57c0f9d1e91e832.json index d0df28a..557cf42 100644 --- a/.sqlx/query-530d3f59ba6d986d3354242ff25faae78671d69c8935d2a2d57c0f9d1e91e832.json +++ b/.sqlx/query-530d3f59ba6d986d3354242ff25faae78671d69c8935d2a2d57c0f9d1e91e832.json @@ -1,64 +1,99 @@ { - "db_name": "PostgreSQL", + "db_name": "SQLite", "query": "SELECT id, ptype, v0, v1, v2, v3, v4, v5 from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", - "type_info": "Int4" + "ordinal": 0, + "type_info": "Integer", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "id" + } + } }, { - "ordinal": 1, "name": "ptype", - "type_info": "Varchar" + "ordinal": 1, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "ptype" + } + } }, { - "ordinal": 2, "name": "v0", - "type_info": "Varchar" + "ordinal": 2, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v0" + } + } }, { - "ordinal": 3, "name": "v1", - "type_info": "Varchar" + "ordinal": 3, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v1" + } + } }, { - "ordinal": 4, "name": "v2", - "type_info": "Varchar" + "ordinal": 4, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v2" + } + } }, { - "ordinal": 5, "name": "v3", - "type_info": "Varchar" + "ordinal": 5, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v3" + } + } }, { - "ordinal": 6, "name": "v4", - "type_info": "Varchar" + "ordinal": 6, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v4" + } + } }, { - "ordinal": 7, "name": "v5", - "type_info": "Varchar" + "ordinal": 7, + "type_info": "Text", + "origin": { + "Table": { + "table": "casbin_rule", + "name": "v5" + } + } } ], "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] + "Right": 12 }, "nullable": [ false, diff --git a/.sqlx/query-5c221dea5dbeb61d1fa6881874adde4cdf8b9510ed4f6170db482ab4373b30a1.json b/.sqlx/query-5c221dea5dbeb61d1fa6881874adde4cdf8b9510ed4f6170db482ab4373b30a1.json new file mode 100644 index 0000000..72c1ccd --- /dev/null +++ b/.sqlx/query-5c221dea5dbeb61d1fa6881874adde4cdf8b9510ed4f6170db482ab4373b30a1.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM casbin_rule WHERE\n ptype = ?1 AND\n (v3 is NULL OR v3 = COALESCE(?2,v3)) AND\n (v4 is NULL OR v4 = COALESCE(?3,v4)) AND\n (v5 is NULL OR v5 = COALESCE(?4,v5))", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "5c221dea5dbeb61d1fa6881874adde4cdf8b9510ed4f6170db482ab4373b30a1" +} diff --git a/.sqlx/query-5e197eb50652dbbfd14df29b60ae05246b9aa3b2ac15b40c75a572a27985d1b7.json b/.sqlx/query-5e197eb50652dbbfd14df29b60ae05246b9aa3b2ac15b40c75a572a27985d1b7.json new file mode 100644 index 0000000..81c79cf --- /dev/null +++ b/.sqlx/query-5e197eb50652dbbfd14df29b60ae05246b9aa3b2ac15b40c75a572a27985d1b7.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM casbin_rule WHERE\n ptype = ?1 AND\n (v4 is NULL OR v4 = COALESCE(?2,v4)) AND\n (v5 is NULL OR v5 = COALESCE(?3,v5))", + "describe": { + "columns": [], + "parameters": { + "Right": 3 + }, + "nullable": [] + }, + "hash": "5e197eb50652dbbfd14df29b60ae05246b9aa3b2ac15b40c75a572a27985d1b7" +} diff --git a/.sqlx/query-691960c016861fbb27f123f9a4e4b70295c22468126e4aff4a5ea09166aa89e6.json b/.sqlx/query-691960c016861fbb27f123f9a4e4b70295c22468126e4aff4a5ea09166aa89e6.json new file mode 100644 index 0000000..b0a37b1 --- /dev/null +++ b/.sqlx/query-691960c016861fbb27f123f9a4e4b70295c22468126e4aff4a5ea09166aa89e6.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM casbin_rule WHERE\n ptype = ?1 AND\n (v0 is NULL OR v0 = COALESCE(?2,v0)) AND\n (v1 is NULL OR v1 = COALESCE(?3,v1)) AND\n (v2 is NULL OR v2 = COALESCE(?4,v2)) AND\n (v3 is NULL OR v3 = COALESCE(?5,v3)) AND\n (v4 is NULL OR v4 = COALESCE(?6,v4)) AND\n (v5 is NULL OR v5 = COALESCE(?7,v5))", + "describe": { + "columns": [], + "parameters": { + "Right": 7 + }, + "nullable": [] + }, + "hash": "691960c016861fbb27f123f9a4e4b70295c22468126e4aff4a5ea09166aa89e6" +} diff --git a/.sqlx/query-7067873f4ca887bf691a3b92a723b648636a2b394df7deec3253d5fc8bacdde1.json b/.sqlx/query-7067873f4ca887bf691a3b92a723b648636a2b394df7deec3253d5fc8bacdde1.json new file mode 100644 index 0000000..173fa57 --- /dev/null +++ b/.sqlx/query-7067873f4ca887bf691a3b92a723b648636a2b394df7deec3253d5fc8bacdde1.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM casbin_rule WHERE\n ptype = ?1 AND\n v0 = ?2 AND\n v1 = ?3 AND\n v2 = ?4 AND\n v3 = ?5 AND\n v4 = ?6 AND\n v5 = ?7", + "describe": { + "columns": [], + "parameters": { + "Right": 7 + }, + "nullable": [] + }, + "hash": "7067873f4ca887bf691a3b92a723b648636a2b394df7deec3253d5fc8bacdde1" +} diff --git a/.sqlx/query-87fa46998bdfaeab2400a20493f525236e8ca6451b3b3f9b803d63cdba952cf8.json b/.sqlx/query-87fa46998bdfaeab2400a20493f525236e8ca6451b3b3f9b803d63cdba952cf8.json new file mode 100644 index 0000000..3407fb8 --- /dev/null +++ b/.sqlx/query-87fa46998bdfaeab2400a20493f525236e8ca6451b3b3f9b803d63cdba952cf8.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM casbin_rule WHERE\n ptype = ?1 AND\n (v1 is NULL OR v1 = COALESCE(?2,v1)) AND\n (v2 is NULL OR v2 = COALESCE(?3,v2)) AND\n (v3 is NULL OR v3 = COALESCE(?4,v3)) AND\n (v4 is NULL OR v4 = COALESCE(?5,v4)) AND\n (v5 is NULL OR v5 = COALESCE(?6,v5))", + "describe": { + "columns": [], + "parameters": { + "Right": 6 + }, + "nullable": [] + }, + "hash": "87fa46998bdfaeab2400a20493f525236e8ca6451b3b3f9b803d63cdba952cf8" +} diff --git a/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/.sqlx/query-dc8abb55cf0b35edab2a568a287c7eed460ca39ffb72076a3b8445c42ee21e00.json similarity index 55% rename from .sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json rename to .sqlx/query-dc8abb55cf0b35edab2a568a287c7eed460ca39ffb72076a3b8445c42ee21e00.json index 4a5f7e8..ad42868 100644 --- a/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json +++ b/.sqlx/query-dc8abb55cf0b35edab2a568a287c7eed460ca39ffb72076a3b8445c42ee21e00.json @@ -1,15 +1,12 @@ { - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", + "db_name": "SQLite", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE(?2,v5))", "describe": { "columns": [], "parameters": { - "Left": [ - "Text", - "Varchar" - ] + "Right": 2 }, "nullable": [] }, - "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" + "hash": "dc8abb55cf0b35edab2a568a287c7eed460ca39ffb72076a3b8445c42ee21e00" } diff --git a/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json deleted file mode 100644 index ef54cdb..0000000 --- a/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" -} diff --git a/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json deleted file mode 100644 index 0daaa8a..0000000 --- a/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" -} diff --git a/shell.nix b/shell.nix index 916506d..2efe16a 100644 --- a/shell.nix +++ b/shell.nix @@ -25,6 +25,7 @@ pkgs.mkShell { stdenv gcc rustc + sqlx-cli ]; # RUST_BACKTRACE = "full";