Skip to content

KirioXX/pg_flagsmith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg_flagsmith


Source Code: KirioXX/pg_flagsmith


Summary

pg_flagmith is a wrapper for the Flagsmith client to query feature flags.

API

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

Try it Out

Spin up Postgres with pg_jsonschema installed in a docker container via docker-compose up. The database is available at postgresql:https://postgres:password@localhost:5407/app

Installation

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.

Prior Art

flagsmith-rust-client - The SDK for Rust applications for Flagsmith

Server Side SDKs - Flagsmith client documentation for servers

About

Postgres flagsmith extension

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages