Data Types¶
Overview¶
Data Types are generic and will be moved from the Segmenter specific block. They hold a reference for any data in any table to be interpreted in a specific way. The defaults include "number" and "string", but this now allows for more Cubed specific types such as "referer" or "product" etc...
A Data Type will have Operators assigned to it, and these can be expanded upon too.
Function Data Type¶
attrib_function_data_type
id | name |
---|---|
1 | number |
2 | referer |
3 | product |
4 | event |
Operators¶
attrib_function_operator
id | name | symbol |
---|---|---|
1 | gt | > |
2 | gte | >= |
3 | le | < |
4 | lte | <= |
5 | contains | % |
6 | startswith | ^ |
6 | endsswith | $ |
We have both name and symbol for a developer to implement which ever is best at the point of use.
If you're doing regex, you should be able to dynamically use the symbol
variable in code, or you can use the name
value and write specific logic.
This will be helpful when applied to logic handling Referer(s) and the code requires to either care about a Visitor's Journey.
Which could be a string formatted like:
"(1),(2),(1)"
Or as a name String:
"Direct, SEO, Direct"
Or an array of Django models:
[<Referer Object (1)>, <Referer Object (2)>, <Referer Object (1)>]
Joining Data Types and Operators¶
attrib_function_data_type_operator
id | function_data_type_id | function_operator_id |
---|---|---|
1 | 1 | 1 |
All Data Types will need their relative Operators assigned to them.