# decorator-mysql **Repository Path**: xuanxiaoqian/decorator-mysql ## Basic Information - **Project Name**: decorator-mysql - **Description**: 爱用装饰器风格查询MySQL的框架一枚鸭~ - **Primary Language**: NodeJS - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-11-17 - **Last Updated**: 2025-06-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # decorator-mysql 爱用装饰器风格查询MySQL的框架一枚鸭~
文档:文档网站 ## 安装 ~~~sh npm i decorator-mysql ~~~ ​ ​ ## 快速开始 1. 初始化数据源 ```ts import { initMysql } from "decorator-mysql"; const pool = initMysql({ host: 'localhost', user: 'root', password: '123456', database: 'decorator_mysql', port: 3306, connectionLimit: 10, }); ``` 2. 查询装饰器 ```ts import { Select, SelectResults } from 'decorator-mysql' @Select('select * from user') selectUserById: () => SelectResults ``` 3. 使用 ```ts await new xxx().selectUserById() ``` ​ ## 趣味对比 ​ ​ ​ ## 疑问交流 暂无