View on GitHub

Relational

Educational tool for relational algebra

Downloads | Screenshots | Query language | Grammar | Types | GUI | Optimizations |

Types and casting rules

Supported types

Relational supports the following types: str int float None Rdate. The Rdate type is specific to relational.

Type Rdate

Strings in the format YYYY-MM-DD can be casted as Rdate.

Fields

Automatic casting and csv files

When loading csv files or editing a relation from the GUI, relational will perform automatic casting.
The casting is column based, so if a column contains only numbers, they will all be cast as float or int. If there is a string value in the column, they will all be considered str.
If a column contains all values in the format YYYY-MM-DD they will all be converted to Rdate.

Some queries return None (the Python equivalent of null). The None value can't be stored in csv files. When reloading it will just be a "None" string.
To properly save a relation keeping the types, use the json format.

Json format

The json format keeps type information, so no casting is performed.