Socket
Socket
Sign inDemoInstall

express-mybatis-mapper

Package Overview
Dependencies
5
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    express-mybatis-mapper

mybatis-mapper express middleware


Version published
Maintainers
1
Created

Readme

Source

express-mybatis-mapper

GitHub license

mybatis-mapper express middleware

It can be installed as follows:

npm install --save express-mybatis-mapper

Middleware registration is as follows.
Pass the path of mybatis files to be registered as an array.

const express = require("express");
const app = express();
......
const mybatis = require("express-mybatis-mapper");
app.use(mybatis(["./example.xml", "./example2.xml"]));
......

After that, you will have a mybatisMapper field in your request object.
If you pass mybatis namespace, id, and context object in order to the getStatement method, the query text is generated and returned.

...
router.get("/", (req, res, next)=>{
    ...
    //generate query text
    const query = req.mybatisMapper.getStatement("example", "SELECT.001", {foo:"bar"});
    ...
});
...

Keywords

FAQs

Last updated on 15 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc