Giter VIP home page Giter VIP logo

Comments (6)

MrTreasure avatar MrTreasure commented on September 16, 2024
  1. 为什么每次执行数据库操作都要放一个conn,是为了操作其他数据库吗?
  2. 每次操作都会执行_getConnection(排除入参传了conn),这个是从连接池取得的连接,但是连接池是同步代码创建的,那么从连接池取得连接时开启了数据库吗?还是说连接池一直打开着数据库?
  3. java .net同步代码通过连接池打开数据库的方式和node一样吗?

from hstardoc.

MrTreasure avatar MrTreasure commented on September 16, 2024

希望再来个MongoDB Helper放在issue 😘

from hstardoc.

hstarorg avatar hstarorg commented on September 16, 2024

那是可选的,是为了处理事务。

from hstardoc.

hstarorg avatar hstarorg commented on September 16, 2024

至于MongoDB的,貌似一般人都用Mongoose,我自己倒是喜欢用Helper。。

from hstardoc.

hstarorg avatar hstarorg commented on September 16, 2024

这个Helper,我会重构下,放到koa-for-rest中。

from hstardoc.

hstarorg avatar hstarorg commented on September 16, 2024

如何使用?

let pool = mysql.createPool({
    connectionLimit: 10,
    host: '192.168.1.200',
    port: 3308,
    user: 'root',
    password: 'xxx',
    database: 'TestDB'
  });
let  db = new MysqlClient(pool);

from hstardoc.

Related Issues (20)

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.