02 June 2021
less than a minute read
We are continuously working on improving and enhancing our data loading functionalities. Over the last weeks, several new features have been released.
Most notably, JSON data can now be loaded into your database within Rel as easy as
def config[:path] = "my_data.json" def json = load_json[config]
and without the need of using an SDK. For more details, please check out our JSON Import and Export tutorial.
We are happy to announce that we support now spaces and many other non-alphanumeric characters in CSV column names. For instance, the file
abbrev.,state name AL,Alabama WY,Wyoming
loads now into Rel as any other CSV file.
def mydata = load_csv["/path/to/my/data.csv"] def output = mydata (DelveTypes.FilePos(19), :abbrev., "AL") (DelveTypes.FilePos(30), :abbrev., "WY") (DelveTypes.FilePos(19), :state name, "Alabama") (DelveTypes.FilePos(30), :state name, "Wyoming")
To access your CSV column in Rel, use the new stdlib functionality
def output = mydata[_, (col: relname_string(col, "state name"))] "Alabama" "Wyoming"
You can now easily index your CSV data with the row number by applying
lined_csv on your loaded CSV data.
def mydata = lined_csv[load_csv["/path/to/my/data.csv"]] def output = mydata (1, :abbrev., "AL") (2, :abbrev., "WY") (1, :state name, "Alabama") (2, :state name, "Wyoming")
This replaces the standard
FilePos data type with and the data row number of the CSV file.
We are excited to announce worksheets, a new interface for submitting Rel queries. Worksheets allow you to develop blocks of Rel code and run them against a database. They can be shared with other users using their URLs.Read More
We are excited to announce the support of varargs in Rel. You can use varargs to write more general code that works for multiple arities. Varargs can be useful when writing generic relations for common utilities.Read More
Value types help distinguish between different kinds of values, even though the underlying representation may be identical. Value types can be used to define other value types.Read More