1
mirror of https://github.com/CarmJos/EasySQL.git synced 2024-09-19 21:35:47 +00:00
EasySQL/README.md

218 lines
6.3 KiB
Markdown
Raw Normal View History

2021-12-11 16:09:19 +00:00
```text
______ _____ ____ __
/ ____/___ ________ __ / ___// __ \ / /
/ __/ / __ `/ ___/ / / / \__ \/ / / / / /
/ /___/ /_/ (__ ) /_/ / ___/ / /_/ / / /___
/_____/\__,_/____/\__, / /____/\___\_\/_____/
/____/
```
# EasySQL
2021-12-14 09:24:45 +00:00
2021-12-14 08:14:53 +00:00
[![version](https://img.shields.io/github/v/release/CarmJos/EasySQL)](https://github.com/CarmJos/EasySQL/releases)
2021-12-13 21:34:12 +00:00
[![License](https://img.shields.io/github/license/CarmJos/EasySQL)](https://opensource.org/licenses/GPL-3.0)
[![workflow](https://github.com/CarmJos/EasySQL/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/EasySQL/actions/workflows/maven.yml)
2021-12-14 08:16:18 +00:00
[![CodeFactor](https://www.codefactor.io/repository/github/carmjos/easysql/badge)](https://www.codefactor.io/repository/github/carmjos/easysql)
![CodeSize](https://img.shields.io/github/languages/code-size/CarmJos/EasySQL)
2021-12-13 21:34:12 +00:00
![](https://visitor-badge.glitch.me/badge?page_id=EasySQL.readme)
2021-12-13 20:32:11 +00:00
简单便捷的数据库操作工具,可自定义连接池来源。
随项目分别提供 [BeeCP](https://github.com/Chris2018998/BeeCP) 与 [Hikari](https://github.com/brettwooldridge/HikariCP~~~~)
两个连接池的版本。
## 优势
- 基于JDBC开发可自选连接池、JDBC驱动。
- 简单便捷的增删改查接口无需手写SQL语句。
- 额外提供部分常用情况的SQL操作
2021-12-14 10:30:27 +00:00
- 自动关闭数据流
2021-12-13 20:32:11 +00:00
- 支持同步操作与异步操作
2021-12-13 20:41:11 +00:00
## 开发
2021-12-13 20:32:11 +00:00
2021-12-14 11:51:41 +00:00
详细开发介绍请 [点击这里](.documentation/README.md) , JavaDoc(最新Release) 请 [点击这里](https://carmjos.github.io/EasySQL) 。
2021-12-13 20:41:11 +00:00
### 示例代码
2022-01-25 15:39:11 +00:00
您可以 [点击这里](example/easysql-demo/src/main/java/EasySQLDemo.java) 查看部分代码演示,更多演示详见 [开发介绍](.documentation/README.md) 。
2021-12-13 21:31:13 +00:00
2022-01-04 20:56:57 +00:00
### 依赖方式
#### Maven 依赖
2021-12-13 20:32:11 +00:00
2021-12-20 11:07:04 +00:00
<details>
2022-01-04 20:56:57 +00:00
<summary>远程库配置</summary>
2021-12-13 20:32:11 +00:00
2021-12-20 11:07:04 +00:00
```xml
2022-01-04 20:56:57 +00:00
2021-12-13 20:32:11 +00:00
<project>
<repositories>
2022-01-28 22:02:25 +00:00
2021-12-13 20:32:11 +00:00
<repository>
2022-01-28 22:02:25 +00:00
<!--采用Maven中心库安全稳定但版本更新需要等待同步-->
<id>maven</id>
<name>Maven Central</name>
2022-02-03 14:00:24 +00:00
<url>https://repo1.maven.org/maven2</url>
2022-01-28 22:02:25 +00:00
</repository>
<repository>
<!--采用github依赖库实时更新但需要配置 (推荐) -->
2022-01-04 20:56:57 +00:00
<id>EasySQL</id>
2021-12-13 20:32:11 +00:00
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/CarmJos/EasySQL</url>
</repository>
2022-01-04 20:56:57 +00:00
<repository>
<!--采用我的私人依赖库,简单方便,但可能因为变故而无法使用-->
<id>carm-repo</id>
<name>Carm's Repo</name>
<url>https://repo.carm.cc/repository/maven-public/</url>
</repository>
2021-12-13 20:32:11 +00:00
</repositories>
2021-12-20 11:07:04 +00:00
</project>
```
</details>
<details>
2022-01-04 20:56:57 +00:00
<summary>原生依赖</summary>
2021-12-20 11:07:04 +00:00
```xml
2022-01-04 20:56:57 +00:00
2021-12-20 11:07:04 +00:00
<project>
2021-12-13 20:32:11 +00:00
<dependencies>
<!--对于需要提供公共接口的项目可以仅打包API部分方便他人调用-->
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-api</artifactId>
2021-12-13 21:31:13 +00:00
<version>[LATEST RELEASE]</version>
2021-12-13 20:32:11 +00:00
<scope>compile</scope>
</dependency>
<!--如需自定义连接池则可以仅打包实现部分自行创建SQLManager-->
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-impl</artifactId>
2021-12-13 21:31:13 +00:00
<version>[LATEST RELEASE]</version>
2021-12-13 20:32:11 +00:00
<scope>compile</scope>
</dependency>
2021-12-20 11:07:04 +00:00
</dependencies>
</project>
```
2022-01-04 20:56:57 +00:00
2021-12-20 11:07:04 +00:00
</details>
<details>
2022-01-04 20:56:57 +00:00
<summary>含连接池版本</summary>
2021-12-13 20:32:11 +00:00
2021-12-20 11:07:04 +00:00
```xml
2022-01-04 20:56:57 +00:00
2021-12-20 11:07:04 +00:00
<project>
<dependencies>
2021-12-13 20:32:11 +00:00
<!--也可直接选择打包了连接池的版本-->
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-beecp</artifactId>
<version>[LATEST VERSION]</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-hikaricp</artifactId>
<version>[LATEST VERSION]</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
```
2021-12-20 11:07:04 +00:00
</details>
2022-01-04 20:56:57 +00:00
#### Gradle 依赖
<details>
<summary>远程库配置</summary>
```groovy
repositories {
2022-01-28 22:02:25 +00:00
// 采用Maven中心库安全稳定但版本更新需要等待同步
mavenCentral()
// 采用github依赖库实时更新但需要配置 (推荐)
2022-01-04 20:59:02 +00:00
maven { url 'https://maven.pkg.github.com/CarmJos/EasySQL' }
2022-01-08 09:29:26 +00:00
2022-01-04 20:59:02 +00:00
// 采用我的私人依赖库,简单方便,但可能因为变故而无法使用
maven { url 'https://repo.carm.cc/repository/maven-public/' }
2022-01-04 20:56:57 +00:00
}
```
</details>
<details>
<summary>原生依赖</summary>
```groovy
dependencies {
2022-01-08 09:29:26 +00:00
2022-01-04 20:56:57 +00:00
//对于需要提供公共接口的项目可以仅打包API部分方便他人调用
2022-01-04 21:09:49 +00:00
api "cc.carm.lib:easysql-api:[LATEST RELEASE]"
2022-01-04 20:56:57 +00:00
//如需自定义连接池则可以仅打包实现部分自行创建SQLManager
2022-01-04 21:09:49 +00:00
api "cc.carm.lib:easysql-impl:[LATEST RELEASE]"
2022-01-08 09:29:26 +00:00
2022-01-04 20:56:57 +00:00
}
```
</details>
<details>
<summary>含连接池版本</summary>
```groovy
dependencies {
2022-01-08 09:29:26 +00:00
2022-01-04 20:56:57 +00:00
//也可直接选择打包了连接池的版本
2022-01-04 21:09:49 +00:00
api "cc.carm.lib:easysql-beecp:[LATEST RELEASE]"
api "cc.carm.lib:easysql-hikaricp:[LATEST RELEASE]"
2022-01-08 09:29:26 +00:00
2022-01-04 20:56:57 +00:00
}
```
2022-01-08 09:29:26 +00:00
2022-01-04 20:56:57 +00:00
</details>
2021-12-11 16:09:19 +00:00
## 支持与捐赠
若您觉得本插件做的不错,您可以通过捐赠支持我!
感谢您对开源项目的支持!
<img height=25% width=25% src="https://raw.githubusercontent.com/CarmJos/CarmJos/main/img/donate-code.jpg" alt=""/>
2021-12-13 21:34:12 +00:00
## 开源协议
2022-01-08 09:29:26 +00:00
本项目源码采用 [The MIT License](https://opensource.org/licenses/MIT) 开源协议。
2021-12-20 11:09:57 +00:00
<details>
2022-01-08 09:29:26 +00:00
<summary>关于 MIT 协议</summary>
2021-12-20 11:09:57 +00:00
2022-01-08 09:29:26 +00:00
> MIT 协议可能是几大开源协议中最宽松的一个,核心条款是:
>
> 该软件及其相关文档对所有人免费,可以任意处置,包括使用,复制,修改,合并,发表,分发,再授权,或者销售。唯一的限制是,软件中必须包含上述版 权和许可提示。
2021-12-13 21:34:12 +00:00
>
2022-01-08 09:29:26 +00:00
> 这意味着:
> - 你可以自由使用,复制,修改,可以用于自己的项目。
> - 可以免费分发或用来盈利。
> - 唯一的限制是必须包含许可声明。
2021-12-13 21:34:12 +00:00
>
2022-01-08 09:29:26 +00:00
> MIT 协议是所有开源许可中最宽松的一个,除了必须包含许可声明外,再无任何限制。
2021-12-13 21:34:12 +00:00
>
> *以上文字来自 [五种开源协议GPL,LGPL,BSD,MIT,Apache](https://www.oschina.net/question/54100_9455) 。*
2022-01-28 21:51:40 +00:00
</details>