Skip to content

Proposal: Swarm DB - ORM tooling #87

@molekilla

Description

@molekilla

Swarm DB - ORM Object Relational Mapper

Swarm DB ORM Object Relational Mapper

Summary

A well design database is able to work with an ORM Object Relational Mapper, in this case we take ideas from existing tooling like Typechain, AbiType, Solido, and Web 2.0 tooling like Mongoose

Guide-level explanation

Beeson type mapping

We can create a type mapper to build Code-first Typescript classes using annotations.

class MyBeesonClass {
  @simpleType({
    name: 'qty' // optional,
    type: 'uint'
  })
  public quantity: number;
  
 @containerType({
    type: 'SoC'
  })
  public inventoryRefs: [];
  
  @contractMappingTo({ address, method, name, options })
  public transferMethod: (sendTo: string, wei: BigNumber) => Promise<any>;

  @query(` ... JEXL query...`)
  public listExistingInventoryByLocation() // eg Spring Boot like
}

Copyright

Copyright and related rights waived via CC0.

Author

@molekilla (Rogelio Morrell)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions