Explore features
Discover and share features by searching, filtering, and analyzing relationships between features persisted in the FeatureMesh registry using FeatureQL commands.
Syntax
Diagram(
Stack(
Sequence(
Terminal("SHOW"),
Choice(0, Skip(), "MY"),
Choice(0, Skip(), "RECENT"),
Choice(0, "FEATURES", "FEATURE"),
Choice(0, Skip(), Sequence(Terminal("("),
Choice(0, Skip(), Sequence(Terminal("INCLUDE"), NonTerminal("include"))),
Choice(0, Skip(), Sequence(Terminal("EXCLUDE"), NonTerminal("exclude"))),
Choice(0, Skip(), Sequence(Terminal("COLUMNS"), NonTerminal("columns")))
, Terminal(")"))),
),
Sequence(
Choice(0, Skip(), OneOrMore(NonTerminal("feature_name"), ",")),
Choice(0, Skip(), Sequence(Terminal("IN"), NonTerminal("namespace"), Choice(0, Skip(), Sequence(Terminal("UP TO LEVEL"), NonTerminal("level"))))),
Choice(0, Skip(), Sequence(Terminal("LIKE"), NonTerminal("like"))),
),
Sequence(
Choice(0, Skip(), Sequence("WHERE", NonTerminal("where"))),
Choice(0, Skip(), Sequence("ORDER BY", NonTerminal("order_by"))),
Choice(0, Skip(), Sequence("LIMIT", NonTerminal("limit")))
)
)
)Here's the list of available metadata fields that you can use in INCLUDE, EXCLUDE, COLUMNS and the WHERE and ORDER BY clauses.
| Field | Type | Description |
|---|---|---|
id | VARCHAR | Unique identifier for the feature |
name | VARCHAR | Fully qualified name (includes namespace) |
datatype | VARCHAR | Data type of the feature |
function | VARCHAR | Associated function (as shown in SHOW FUNCTIONS) |
params | ROW | Parameter details (kind, name, type) |
created_at | ROW | Date of creation |
updated_at | ROW | Date of update |
Example
Let's create a few features to explore:
We can see the features we created:
Now let's replace the features with new ones:
Simplified Syntax
FeatureQL provides several shorthand commands for common queries:
Here are some common simplified FeatureQL queries, with descriptions to clarify their behavior:
| Use Case | Example Query | Equivalent Expanded Query/Comment |
|---|---|---|
| Show a specific feature | SHOW FEATURE NAME_OF_THE_FEATURE; | Filters for an exact name. Same as: WHERE name = 'NAME_OF_THE_FEATURE' |
| Show multiple features | SHOW FEATURES NAME1, NAME2; | Filters to the given names. Same as: WHERE name IN ('NAME1', 'NAME2') |
| Show features by pattern | SHOW FEATURES LIKE 'fm.customers.%'; | Filters by pattern. Same as: WHERE name LIKE 'fm.customers.%' |
| Features in a namespace | SHOW FEATURES IN 'fm.customers'; | Only features directly within this namespace. E.g., fm.customers.segment1 is in, but fm.customers.project1.segment1 is not. |
| Namespace + max depth | SHOW FEATURES IN 'fm.customers' UP TO LEVEL 2; | Returns features in the namespace up to the given depth. E.g., fm.customers.project1.segment1 (2 levels deep) will be included. |
| Features you maintain | SHOW MY FEATURES; | Filters where you are point of contact. Same as: WHERE point_of_contact = '<your_email>' |
| Most recent features | SHOW RECENT FEATURES; | Returns the most recently created features. Same as: ORDER BY created_at DESC LIMIT 50 |
You can always mix and match these shortcuts for powerful filtering!
For example: @fql-playground(show_features_simplified)
Dependency Analysis
FeatureQL provides special operators for exploring feature dependencies that you can use in the WHERE condition.
| Operator | Description |
|---|---|
IS_UPSTREAM_OF(feature) | Returns true if the current feature is a dependency of the specified feature |
IS_DOWNSTREAM_OF(feature) | Returns true if the current feature is dependent on the specified feature |
DEPTH_RELATIVE_TO(feature) | Returns the relative depth of the current feature to the specified feature |
To demonstrate relationship analysis, let's create a set of interconnected features:
This creates a dependency chain: RFEATURE0 → RFEATURE2 → RFEATURE3 → RFEATURE4, with RFEATURE1 also feeding into RFEATURE3.
Upstream dependencies
Let's get the features that the feature RFEATURE3 depends on:
Downstream dependencies
Let's get the features that depend on the feature RFEATURE3:
Relative depth
Let's get all the features linked to RFEATURE3 and their relative depth in the dependency DAG: