Skip to content

DataMapper #7

@harell

Description

@harell

See [@Peaa, p. 165]

Main Features

  • Store R6 objects in a relational database
  • Retrieve R6 objects from a relational database

Under the Hood

  • Store R6 objects in Entity–attribute–value model (EAV) data model
    • Entity is the object uid. If not supplied then use md5hash?
    • Attribute is one of four: public_field, public_method, private_field or private_method
    • Value is an unboxed json string (character)
  • Optional: Include an additional entry that holds the result of serialize R6 object.

Hint

Examples

Pseudocode: Mappin a person object to and from database

character <- person(given = "Bilbo", family = "Baggins")
class(character) # person

CharacterMapper$insert(character)
candidates <- CharacterMapper$find(given = "Bilbo")

class(candidates) # list of persons
identical(candidates[[1]], character)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions