Giter Site home page Giter Site logo

josh-cena / berry-orm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from char2sgu/berry-orm

0.0 1.0 0.0 1.67 MB

Object Relational Mapping for front-ends.

Home Page: https://thenightmarex.github.io/berry-orm/

License: Apache License 2.0

JavaScript 1.55% TypeScript 98.31% Shell 0.15%

berry-orm's Introduction

Berry ORM

中文

Object Relational Mapping for front-ends.

What it solves?

Usually, the front-end will not process the data obtained from the back-end, but directly uses these plain objects. In large-scale applications, this can easily lead to extremely complex and messy relation processing code. Berry ORM allows you to access relation objects directly through attributes to avoid the boring relation-processing code.

Let's take an extreme example:

When using Berry ORM, you can directly access the relation objects through the attributes:

user.department.tasks.forEach((task) => {
  console.log(task.creator.username);
});

While when Berry ORM is not used, you must obtain the relation objects manually according the primary keys:

const userDepartment = departmentMap[user.department];
const departmentTasks = Object.values(taskMap).filter(
  (task) => task.department == userDepartment.id,
);
departmentTasks.forEach((task) => {
  const taskCreator = userMap[task.creator];
  console.log(taskCreator.username);
});

What it is not?

On the back-end, most ORM libraries are not only responsible for Object Relational Mapping, but also include a variety of additional functions such as wrapping database queries, optimization of SQL statements, and so on. But Berry ORM is only responsible for Object Relation mapping, it is only responsible for mapping the relations between objects.

Documents

https://thenightmarex.github.io/berry-orm/

berry-orm's People

Contributors

char2sgu avatar josh-cena avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.