You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,20 +18,20 @@ Data engineers can use Jayvee and its interpreter to clean and preprocess data f
18
18
19
19
Explore a glimpse of our upcoming features in the following list. This overview is broad and subject to evolution. We're excited to share our vision of the exciting journey ahead, and we invite you to accompany us on this adventure!
20
20
21
-
-✅ Blocks and pipes
21
+
-✅ Blocks and pipes
22
22
-✅ Simple value types and constraints
23
23
-✅ Natively support table-based data
24
24
-✅ Column-based transformations
25
25
-✅ Describe blocks via builtin block types in Jayvee
26
26
-✅ Compose logic of multiple blocks via composite block types
27
27
-✅ Multi-file Jayvee to distribute programs over multiple files
28
28
-✅ Jayvee formatter
29
-
-⌛ Improve the syntax of value types (see [RFC 0014](https://github.com/jvalue/jayvee/pull/409))
29
+
-✅ Improve the syntax of value types (see [RFC 0014](https://github.com/jvalue/jayvee/pull/409))
30
+
-✅ Composite value types (with multiple fields)
30
31
-⌛ Reusable libraries (with a package manager)
31
32
-⌛ Further extractors and sinks
32
-
-🤔 Composite value types (with multiple fields)
33
+
-⌛ Valuetypes parsers (to read and write different formats)
33
34
-🤔 Natively support tree data (XML, JSON)
34
-
-🤔 Valuetypes parsers (to read and write different formats)
Copy file name to clipboardExpand all lines: apps/docs/docs/user/value-types/primitive-value-types.md
+34-21Lines changed: 34 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,45 +4,58 @@ sidebar_position: 2
4
4
5
5
# Primitive Value Types
6
6
7
-
_Primitive value types_ are based on _built-in value types_ and use a collection of _constraints_ to restrict the range of valid values.
8
-
Such _constraints_ are implicitly connected via a logical `AND` relation.
9
-
Note that the _constraints_ need to be applicable to the base-type of the _value type_ - indicated by the identifier after the keyword `oftype`:
7
+
_Primitive value types_ are comprised of _properties_.
10
8
11
9
```jayvee
12
10
valuetype GasFillLevel {
13
11
property level oftype integer;
14
-
constraint levelRange: GasFillLevelRange on level;
15
12
}
16
13
```
17
14
18
-
## Constraints
15
+
A _Property_ is a named "part" with its own _value type_ (type cycles are
16
+
forbidden). _Value types_ with multiple _properties_ are allowed in the
17
+
language, but not yet supported by the interpreter.
19
18
20
-
_Constraints_ for _value types_ declare the validity criteria that each concrete value is checked against.
21
19
22
-
### Syntax 1: Expression syntax
20
+
##Constraints
23
21
24
-
The syntax of expression-based _constraints_ uses an expression that evaluates to `true` or `false` for the given `value`. The type of the values the expression is working in is indicated ofter the keyword `on`:
22
+
_Constraints_ restrict the range of valid values.
25
23
26
24
```jayvee
27
-
constraint GasFillLevelRange on decimal:
28
-
value >= 0 and value <= 100;
25
+
valuetype GasFillLevel {
26
+
property level oftype integer;
27
+
constraint levelRange: level >= 0 and level <= 100;
28
+
}
29
29
```
30
30
31
-
Refer to the [expression documentation](../expressions.md) for further reading on expressions.
31
+
A _value type_ can have zero or more _constraints_, which are implicitly
32
+
connected via a logical `AND` operation.
33
+
34
+
_Constraints_ use an _expression_ that evaluates to `true` or `false` and can
35
+
reference every _property_ of the _value type_.
36
+
In the above example, `level >= 0 and level <= 100` is evaluated for each value
37
+
of type `GasFillLevel`, `level` being replaced by that properties actual value.
32
38
33
-
### Syntax 2: Block-like syntax
39
+
Refer to the [expression documentation](../expressions.md) for further reading
40
+
on _expressions_.
34
41
35
-
The syntax of _constraints_ is similar to the syntax of _blocks_.
36
-
The availability of property keys and their respective _value types_ is determined by the type of the _constraint_ - indicated by the identifier after the keyword `oftype`:
42
+
### Outline definition.
43
+
44
+
_Constraints_ can also be defined outside of value types, allowing them to be
0 commit comments