Giter Site home page Giter Site logo

tms-db's Introduction

tms-db

封装常用数据库操作,简化针对数据库的编码,支持 MySQL,SQLite,支持读写分离,支持 escape。

每一次完整的业务处理过程称之为一个context,可以理解为它是业务级的事物。支持多次数据库请求使用同一个数据库连接,支持追踪 sql 语句,支持业务级事物的标识,支持在一次业务处理过程中涉及多个数据库。

支持 json 数据的双向自动转换。

编译

npm run build

API

初始化

支持的配置信息如下:

{
  mysql:{
    master: {},
    writalbe: {}
  },
  sqlite:{
    path: '',
    memory: false
  }
}

安装包的时候不自动安装依赖的mysqlbetter-sqlite3(依赖关系放在了 peerDependencies 中),使用tms-db包的工程需要使用哪个数据再安装哪个包。

实例

每个实例保留一个连接

tms-db's People

Contributors

jasony62 avatar liao1a avatar

Watchers

James Cloos avatar

Forkers

zjbhuxian

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.