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

204 lines
6.7 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
### 示例代码
2021-12-14 11:51:41 +00:00
您可以 [点击这里](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>
<repository>
2022-01-04 20:56:57 +00:00
<!--采用github依赖库安全稳定但需要配置 (推荐)-->
<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 {
maven { url 'https://maven.pkg.github.com/CarmJos/EasySQL' } // 采用github依赖库安全稳定但需要配置 (推荐)
maven { url 'https://repo.carm.cc/repository/maven-public/' } // 采用我的私人依赖库,简单方便,但可能因为变故而无法使用
}
```
</details>
<details>
<summary>原生依赖</summary>
```groovy
dependencies {
//对于需要提供公共接口的项目可以仅打包API部分方便他人调用
compileOnly "cc.carm.lib:easysql-api:[LATEST RELEASE]"
//如需自定义连接池则可以仅打包实现部分自行创建SQLManager
compileOnly "cc.carm.lib:easysql-impl:[LATEST RELEASE]"
}
```
</details>
<details>
<summary>含连接池版本</summary>
```groovy
dependencies {
//也可直接选择打包了连接池的版本
compileOnly "cc.carm.lib:easysql-beecp:[LATEST RELEASE]"
compileOnly "cc.carm.lib:easysql-hikaricp:[LATEST RELEASE]"
}
```
</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
## 开源协议
本项目源码采用 [GNU General Public License v3.0](https://opensource.org/licenses/GPL-3.0) 开源协议。
2021-12-20 11:09:57 +00:00
<details>
<summary>关于 GPL 协议</summary>
2021-12-13 21:34:12 +00:00
> GNU General Public Licence (GPL) 有可能是开源界最常用的许可模式。GPL 保证了所有开发者的权利,同时为使用者提供了足够的复制,分发,修改的权利:
>
> #### 可自由复制
> 你可以将软件复制到你的电脑,你客户的电脑,或者任何地方。复制份数没有任何限制。
> #### 可自由分发
> 在你的网站提供下载拷贝到U盘送人或者将源代码打印出来从窗户扔出去环保起见请别这样做
> #### 可以用来盈利
> 你可以在分发软件的时候收费,但你必须在收费前向你的客户提供该软件的 GNU GPL 许可协议,以便让他们知道,他们可以从别的渠道免费得到这份软件,以及你收费的理由。
> #### 可自由修改
> 如果你想添加或删除某个功能,没问题,如果你想在别的项目中使用部分代码,也没问题,唯一的要求是,使用了这段代码的项目也必须使用 GPL 协议。
>
> 需要注意的是,分发的时候,需要明确提供源代码和二进制文件,另外,用于某些程序的某些协议有一些问题和限制,你可以看一下 @PierreJoye 写的 Practical Guide to GPL Compliance 一文。使用 GPL 协议,你必须在源代码代码中包含相应信息,以及协议本身。
>
> *以上文字来自 [五种开源协议GPL,LGPL,BSD,MIT,Apache](https://www.oschina.net/question/54100_9455) 。*
2021-12-20 11:09:57 +00:00
</details>