1
mirror of https://github.com/CarmJos/EasySQL.git synced 2026-06-05 09:01:26 +08:00

Compare commits

...

16 Commits

Author SHA1 Message Date
carm 91d9891532 ci(deploy): 修改部署配置 2022-06-03 03:04:22 +08:00
carm fdb7af541c chore: 修改项目结构与部署方式 2022-06-02 21:53:12 +08:00
carm b467743c2a docs(repo): 修改依赖库地址介绍 2022-06-02 21:51:43 +08:00
carm 3979c6d50c test(query): 添加SuppressWarnings标识 2022-06-02 21:42:34 +08:00
carm 9bac83f739 chore(project): 修改项目文件结构 2022-06-02 21:41:09 +08:00
carm 96ccc604ed ci(reploy): 添加 local-deploy 配置 2022-05-30 04:37:02 +08:00
carm 90db463f1d Merge remote-tracking branch 'origin/master' 2022-05-30 04:36:24 +08:00
carm 9248783a16 ci(reploy): 添加 local-deploy 配置 2022-05-30 04:36:10 +08:00
carm 75e8f02228 Merge pull request #47 from CarmJos/dependabot/maven/com.github.chris2018998-beecp-3.3.6
Bump beecp from 3.3.5 to 3.3.6
2022-05-02 21:13:11 +08:00
dependabot[bot] 02b8d561a8 Bump beecp from 3.3.5 to 3.3.6
Bumps [beecp](https://github.com/Chris2018998/BeeCP) from 3.3.5 to 3.3.6.
- [Release notes](https://github.com/Chris2018998/BeeCP/releases)
- [Commits](https://github.com/Chris2018998/BeeCP/compare/3.3.5...3.3.6)

---
updated-dependencies:
- dependency-name: com.github.chris2018998:beecp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 08:31:36 +00:00
carm 19490d7508 Merge remote-tracking branch 'origin/master' 2022-04-27 02:09:07 +08:00
carm e8a01169d2 [0.3.16] 支持 IS NULL 判断(即设定queryValue为null)。 2022-04-27 02:08:58 +08:00
carm 2e1df7c7f6 Merge pull request #46 from CarmJos/dependabot/maven/org.apache.maven.plugins-maven-javadoc-plugin-3.4.0
Bump maven-javadoc-plugin from 3.3.2 to 3.4.0
2022-04-21 17:04:02 +08:00
dependabot[bot] 1812db3a16 Bump maven-javadoc-plugin from 3.3.2 to 3.4.0
Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.3.2 to 3.4.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.3.2...maven-javadoc-plugin-3.4.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-21 08:31:13 +00:00
carm deb5de35a8 移除api与impl的shaded 2022-04-17 17:23:49 +08:00
carm e9ce0a769c [0.3.15] 版本修复
- `[F]` 修复上一版本中 SQLDebugHandler 的处理出现空指针异常。
2022-04-13 08:04:30 +08:00
23 changed files with 138 additions and 56 deletions
+57 -8
View File
@@ -12,9 +12,8 @@ on:
jobs:
gh-deploy:
name: "Publish Project (GitHub)"
name: "Publish Project (GitHub Packages)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Set up JDK"
@@ -47,7 +46,7 @@ jobs:
id: sitemap
uses: cicirello/generate-sitemap@v1
with:
base-url-path: https://carmjos.github.io/EasySQL
base-url-path: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
path-to-root: docs
- name: "Output stats"
@@ -65,14 +64,14 @@ jobs:
echo "$DEPLOY_PRI" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name 'CarmJos'
git config --global user.email 'carm@carm.cc'
git config --global user.name '${{ github.repository_owner }}'
git config --global user.email '${{ github.repository_owner }}@users.noreply.github.com'
- name: "Commit documentations"
run: |
cd docs
git init
git remote add origin git@github.com:CarmJos/EasySQL.git
git remote add origin git@github.com:${{ github.repository_owner }}/${{ github.event.repository.name }}.git
git checkout -b gh-pages
git add -A
git commit -m "API Document generated."
@@ -85,7 +84,6 @@ jobs:
central-deploy:
name: "Deploy Project (Central Repository)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Set up JDK"
@@ -105,4 +103,55 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASS }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
local-deploy:
name: "Deploy Project (GitHub Repository)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Set up JDK"
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: maven
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: "Maven Deploy"
run: mvn -B -Plocal deploy --file pom.xml -DskipTests
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: "Copy artifacts"
run: |
rm -rf deploy
mkdir -vp deploy
cp -vrf $HOME/local-deploy/* deploy/
- name: "Configure Git"
env:
DEPLOY_PRI: ${{secrets.DEPLOY_PRI}}
run: |
sudo timedatectl set-timezone "Asia/Shanghai"
mkdir -p ~/.ssh/
echo "$DEPLOY_PRI" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name '${{ github.repository_owner }}'
git config --global user.email '${{ github.repository_owner }}@users.noreply.github.com'
- name: "Commit files"
run: |
cd deploy
git init
git remote add origin git@github.com:${{ github.repository_owner }}/${{ github.event.repository.name }}.git
git checkout -b repo
git add -A
git commit -m "Maven project deployment."
- name: "Push files"
run: |
cd deploy
git push origin HEAD:repo --force
+17 -9
View File
@@ -10,7 +10,7 @@
# EasySQL
[![version](https://img.shields.io/github/v/release/CarmJos/EasySQL)](https://github.com/CarmJos/EasySQL/releases)
[![License](https://img.shields.io/github/license/CarmJos/EasySQL)](https://opensource.org/licenses/GPL-3.0)
[![License](https://img.shields.io/github/license/CarmJos/EasySQL)](https://opensource.org/licenses/MIT)
[![workflow](https://github.com/CarmJos/EasySQL/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/EasySQL/actions/workflows/maven.yml)
[![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)
@@ -18,7 +18,7 @@
简单便捷的数据库操作工具,可自定义连接池来源。
随项目分别提供 [BeeCP](https://github.com/Chris2018998/BeeCP) 与 [Hikari](https://github.com/brettwooldridge/HikariCP~~~~)
随项目分别提供 [BeeCP](https://github.com/Chris2018998/BeeCP) 与 [Hikari](https://github.com/brettwooldridge/HikariCP)
两个连接池的版本。
## 优势
@@ -35,7 +35,7 @@
### 示例代码
您可以 [点击这里](example/easysql-demo/src/main/java/EasySQLDemo.java) 查看部分代码演示,更多演示详见 [开发介绍](.documentation/README.md) 。
您可以 [点击这里](demo/src/main/java/EasySQLDemo.java) 查看部分代码演示,更多演示详见 [开发介绍](.documentation/README.md) 。
### 依赖方式
@@ -55,9 +55,16 @@
<name>Maven Central</name>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<!--采用github依赖,实时更新,但需要配置 (推荐) -->
<!--采用github的repo分支依赖,实时更新 (推荐)-->
<id>EasySQL</id>
<name>GitHub Branch Repository</name>
<url>https://github.com/CarmJos/EasySQL/blob/repo/</url>
</repository>
<repository>
<!--采用github packages依赖库,安全稳定,但需要配置 -->
<id>EasySQL</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/CarmJos/EasySQL</url>
@@ -141,8 +148,11 @@ repositories {
// 采用Maven中心库,安全稳定,但版本更新需要等待同步
mavenCentral()
// 采用github依赖,实时更新,但需要配置 (推荐)
// 采用github的repo分支依赖,实时更新 (推荐)
maven { url 'https://github.com/CarmJos/EasySQL/blob/repo/' }
// 采用github依赖库,安全稳定,但需要配置
maven { url 'https://maven.pkg.github.com/CarmJos/EasySQL' }
// 采用我的私人依赖库,简单方便,但可能因为变故而无法使用
@@ -194,8 +204,6 @@ dependencies {
感谢您对开源项目的支持!
<img height=25% width=25% src="https://raw.githubusercontent.com/CarmJos/CarmJos/main/img/donate-code.jpg" alt=""/>
## 开源协议
本项目源码采用 [The MIT License](https://opensource.org/licenses/MIT) 开源协议。
+3 -7
View File
@@ -5,13 +5,13 @@
<parent>
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-parent</artifactId>
<version>0.3.14</version>
<version>0.3.17</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
@@ -78,10 +78,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
</plugins>
</build>
@@ -47,9 +47,7 @@ public interface ConditionalBuilder<B extends ConditionalBuilder<B, T>, T extend
B addCondition(@NotNull String columnName, @NotNull String operator, @Nullable Object queryValue);
default B addCondition(@NotNull String columnName, @Nullable Object queryValue) {
return addCondition(columnName, "=", queryValue);
}
B addCondition(@NotNull String columnName, @Nullable Object queryValue);
B addCondition(@NotNull String[] columnNames, @Nullable Object[] queryValues);
@@ -67,7 +67,7 @@ public interface SQLDebugHandler {
}
if (params.size() == 1) {
Object[] param = params.get(0);
logger.info("┣# SQLParams({}): {}", param.length, parseParams(param));
logger.info("┣# SQLParams: {}", parseParams(param));
} else if (params.size() > 1) {
logger.info("┣# SQLParams: ");
int i = 0;
+7 -4
View File
@@ -5,14 +5,13 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.3.14</version>
<relativePath>../../pom.xml</relativePath>
<version>0.3.17</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven.javadoc.skip>true</maven.javadoc.skip>
@@ -115,6 +114,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -7,6 +7,7 @@ import cc.carm.lib.easysql.TestHandler;
import java.sql.ResultSet;
import java.sql.SQLException;
@SuppressWarnings("resource")
public class QueryNotCloseTest extends TestHandler {
@Override
+3 -7
View File
@@ -5,13 +5,13 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.3.14</version>
<version>0.3.17</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
@@ -81,10 +81,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
</plugins>
</build>
@@ -48,6 +48,16 @@ public abstract class AbstractConditionalBuilder<B extends ConditionalBuilder<B,
return getThis();
}
@Override
public B addCondition(@NotNull String columnName, @Nullable Object queryValue) {
Objects.requireNonNull(columnName, "columnName could not be null");
if (queryValue == null) {
return addCondition(withBackQuote(columnName) + " IS NULL");
} else {
return addCondition(columnName, "=", queryValue);
}
}
@Override
public B addCondition(
@NotNull String columnName, @NotNull String operator, @Nullable Object queryValue
+24 -10
View File
@@ -5,11 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<properties>
<java.version>8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<jdk.version>8</jdk.version>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<sonar.organization>carmjos</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
@@ -17,7 +19,7 @@
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-parent</artifactId>
<packaging>pom</packaging>
<version>0.3.14</version>
<version>0.3.17</version>
<modules>
<module>api</module>
@@ -26,7 +28,7 @@
<module>with-pool/beecp</module>
<module>with-pool/hikaricp</module>
<module>example/demo</module>
<module>demo</module>
</modules>
<name>EasySQL</name>
@@ -94,14 +96,12 @@
</repositories>
<distributionManagement>
<downloadUrl>https://github.com/CarmJos/EasySQL/releases</downloadUrl>
<site>
<id>easysql-javadoc</id>
<name>EasySQL JavaDoc (on Github Pages)</name>
<url>https://CarmJos.github.io/EasySQL</url>
</site>
</distributionManagement>
<dependencies>
@@ -169,7 +169,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<version>3.4.0</version>
<configuration>
<classifier>javadoc</classifier>
<detectJavaApiLink>false</detectJavaApiLink>
@@ -198,8 +198,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<encoding>UTF-8</encoding>
<compilerArgument>-parameters</compilerArgument>
</configuration>
@@ -302,6 +302,20 @@
</distributionManagement>
</profile>
<profile>
<id>local</id>
<distributionManagement>
<snapshotRepository>
<id>localRepository</id>
<url>file:${user.home}/local-deploy/</url>
</snapshotRepository>
<repository>
<id>localRepository</id>
<url>file:${user.home}/local-deploy/</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>
+10 -4
View File
@@ -5,14 +5,14 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.3.14</version>
<version>0.3.17</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
@@ -40,6 +40,12 @@
<license>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<comments>EasySQL的基础源代码采用MIT开源协议。</comments>
</license>
<license>
<name>GNU Lesser General Public License v2.1</name>
<url>https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>
<comments>该版本打包了BeeCP,因此相关代码继续遵循LGPL协议。</comments>
</license>
</licenses>
@@ -73,7 +79,7 @@
<!--项目地址 https://github.com/Chris2018998/BeeCP -->
<groupId>com.github.chris2018998</groupId>
<artifactId>beecp</artifactId>
<version>3.3.5</version>
<version>3.3.6</version>
<optional>true</optional>
<scope>compile</scope>
</dependency>
+4 -3
View File
@@ -5,14 +5,14 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.3.14</version>
<version>0.3.17</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
@@ -39,6 +39,7 @@
<license>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<comments>EasySQL与HikariCP均采用MIT开源协议。</comments>
</license>
</licenses>