From dd4a06c5387fa61f0a480d92d03e33c5332a9f13 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 9 Jul 2025 15:39:47 +1000 Subject: [PATCH] updated README --- .gitignore | 9 +++++++++ README.md | 14 ++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0ca7e79..32cb8ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ +# Ignore build output +/dist/ + +# Ignore SQLite amalgamation sources +/src/sqlite3.c +/src/sqlite3.h +/src/sqlite3ext.h +/src/shell.c + *.log # Prerequisites diff --git a/README.md b/README.md index ac851bb..d1e5f47 100644 --- a/README.md +++ b/README.md @@ -74,10 +74,10 @@ make compile-macos # For macOS After compilation, you can load the extensions in your SQLite shell using: ```sql -.load '/path/to/dist/json_equal' -.load '/path/to/dist/regexp' -.load '/path/to/dist/split_part' -.load '/path/to/dist/aws_policy_equal' +.load 'dist/json_equal' +.load 'dist/regexp' +.load 'dist/split_part' +.load 'dist/aws_policy_equal' ``` Alternatively, you can download the extensions from [__sqlpkg__](https://sqlpkg.org/?q=stackql%2Fjson_equal). @@ -99,6 +99,12 @@ SELECT aws_policy_equal( '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["s3:PutObject","s3:GetObject"],"Resource":"*"}]}' ); -- Returns 1 (true) +-- Compare AWS policies which are different +SELECT aws_policy_equal( + '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["s3:GetObject","s3:PutObject"],"Resource":"*"}]}', + '{"Version":"2012-10-17","Statement":[{"Effect":"Deny","Action":["s3:PutObject","s3:GetObject"],"Resource":"*"}]}' +); -- Returns 0 (false) + -- Compare trust policies with different Principal formats SELECT aws_policy_equal( '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:role/role1"},"Action":"sts:AssumeRole"}]}',