The first steps

Example of data storage

Insert a single cell:

("user" put("project1", "name", "YourProject")) execute
            

Insert a batch in one line:

("user" put("project1", "name", "YourProject") put("project1", "attribute", "open")) execute
           

Example of retrieval

Define the entity transformation from the result:

def userFromResult(rs: Result): User = {
    User(rs.getRow[String], rs("name").as[String], rs("age").as[Int])
}

Scan all rows and return a list of entities:

("user" get rows) ~ userFromResult
            

Get rows inserted in a time range as entities:

val rangeFilter = new TimeFilter(from, to)
("user" get rows filter(rangeFilter)) ~ userFromResult
          

Get a specific row:

("user" get "rowId" qualifiers("name", "age")) ~ userFromResult