INPUT()
All functions > CORE > INPUT()
Returns a reference to an input.
Signatures
Returns: An INPUT marker of the specified type
INPUT(type: DataTypeEnum.TYPE) → INPUT sql
| Parameter | Type | Required | Description |
|---|---|---|---|
type | DataTypeEnum.TYPE | Yes | The data type of the input parameter |
Notes
- Defines an input parameter for a feature
- Input parameters allow features to be parameterized
- The type parameter specifies what kind of value is expected
- Used in feature definitions that accept runtime parameters
- Enables reusable, parameterized feature logic
- Part of the FeatureMesh core system
Examples
INPUT() with ENTITY and FOR / BIND (2-types.slt)
FeatureQL
WITH
entity1 := ENTITY(),
entity2 := ENTITY(),
entity1_id := INPUT(BIGINT#ENTITY1)
SELECT
entity1_id,
plain_id := UNSAFE_CAST(entity1_id AS BIGINT),
key_for_entity2 := UNSAFE_CAST(entity1_id AS BIGINT#ENTITY2),
t_annotated := TYPEOF(entity1_id),
t_plain := TYPEOF(plain_id),
t_remapped := TYPEOF(key_for_entity2),
next_annotated_id := UNSAFE_CAST(
UNSAFE_CAST(entity1_id AS BIGINT) + 1 AS BIGINT#ENTITY1
),
t_next := TYPEOF(next_annotated_id)
FOR
entity1_id := BIND_VALUES(SEQUENCE(1, 3))
;Result
| ENTITY1_ID BIGINT | PLAIN_ID BIGINT | KEY_FOR_ENTITY2 BIGINT | T_ANNOTATED VARCHAR | T_PLAIN VARCHAR | T_REMAPPED VARCHAR | NEXT_ANNOTATED_ID BIGINT | T_NEXT VARCHAR |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | BIGINT#ENTITY1 | BIGINT | BIGINT#ENTITY2 | 2 | BIGINT#ENTITY1 |
| 2 | 2 | 2 | BIGINT#ENTITY1 | BIGINT | BIGINT#ENTITY2 | 3 | BIGINT#ENTITY1 |
| 3 | 3 | 3 | BIGINT#ENTITY1 | BIGINT | BIGINT#ENTITY2 | 4 | BIGINT#ENTITY1 |