ORM 模型系统 Modelar

码农软件 · 软件分类 · ORM/持久层框架 · 2019-09-22 19:57:31

软件介绍

Modelar 是一个基于 Node.js 平台的、富于表现的 ORM 模型系统,它使用 SQL 查询构造器来产生数据库查询语句,并且使用 Promise 机制来进行流程控制。

Modelar 是轻巧的,因此也使得开发更为高效;它简单易用,却功能不凡,它将复杂的数据转换为面向对象的模型,并提供丰富的方法去操作它们;它提供了诸如模型继承与关联、事件处理器等接口,这一切都是为了减少开发人员的工作。

Modelar 目前支持以下数据库:

  1. MySQL

  2. PostgreSQL

  3. SQLite

并且,Modelar 还在成长,更多数据库将在未来版本中获得支持。

使用 Modelar,你至少能过获得这些体验:

  1. 编写更少的代码;

  2. 编写富于表现而又好看的代码;

  3. 使用查询构造器来操作数据;

  4. 自动控制数据库连接。

这是一个简单的示例,它将向你展示 Modelar 的核心功能:

const Model = require("modelar/Model");

class Article extends Model {
    constructor(data) {
        super(data, {
            table: "articles",
            primary: "id",
            fields: [ "id", "title", "content" ],
            searchable: [ "title", "content" ]
        });
    }
}

var article = new Article;
article.title = "A new article with Modelar ORM.";
article.content = "Modelar is an expressive Model.";
article.save();

当然,Modelar 的能力,要远比示例中强大十几甚至几十倍。它所能实现的功能,你需要使用中才能体会得到。

本文地址:https://codercto.com/soft/d/15180.html

Thinking Recursively

Thinking Recursively

Eric S. Roberts / Wiley / 1986-1-17 / USD 85.67

The process of solving large problems by breaking them down into smaller, more simple problems that have identical forms. Thinking Recursively: A small text to solve large problems. Concentrating on t......一起来看看 《Thinking Recursively》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具