Source Code: KirioXX/pg_flagsmith
pg_flagmith
is a wrapper for the Flagsmith client to query feature flags.
SQL functions:
-- Check if a feature [flag] is enabled
is_feature_enabled(flagsmith_key string, flag_name string) returns bool
and
-- Check if a feature [flag] is enabled for a specific [identifier]
is_feature_enabled_for_identity(flagsmith_key string, identifier string, flag_name string) returns bool
Spin up Postgres with pg_jsonschema installed in a docker container via docker-compose up
. The database is available at postgresql://postgres:password@localhost:5407/app
Requires:
cargo pgx run
which drops into a psql prompt.
psql (13.6)
Type "help" for help.
pg_flagsmith=# create extension pg_flagsmith;
CREATE EXTENSION
pg_jsonschema=# select is_feature_enabled('[YOUR_KEY]', '[YOUR_FEATURE_FLAG]');
is_feature_enabled
---------------------
t
(1 row)
for more complete installation guidelines see the pgx docs.
flagsmith-rust-client - The SDK for Rust applications for Flagsmith
Server Side SDKs - Flagsmith client documentation for servers