Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/junit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: JUnit

on: [push]

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Shutdown default MySQL
run: sudo service mysql stop
- name: Setup MySQL
uses: mirromutth/mysql-action@v1.1
with:
mysql database: 'test'
mysql user: 'test'
mysql password: 'test'
mysql port: 3306
- name: Gradle Build
run: ./gradlew build -x test
- name: Gradle Test
run: ./gradlew test
- name: JUnit Report Action
uses: mikepenz/action-junit-report@v3.7.1
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 ZorTik
Copyright (c) 2022-2023 ZorTik

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
39 changes: 5 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,8 @@ Before documentation is done, here is a <a href="https://github.com/ZorTik/Advan
</p>-->

## Installation
You can add Containr to your build path using Maven or Gradle. ContainrGUI is **not a Minecraft plugin**! This means that you can use it's code directly in your project by shading it into your build path.

### Gradle:
Add this project to your build path using Gradle with JitPack as represented below.<br>Download the sources from jitpack.
```
repositories {
maven { url = 'https://jitpack.io' }
}
```
```
dependencies {
implementation 'com.github.ZorTik:AdvancedSQLClient:Tag'
}
```

### Maven:
You can also use Maven with JitPack as seen below.<br>Download the sources from jitpack.
```
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
```
```
<dependency>
<groupId>com.github.ZorTik</groupId>
<artifactId>AdvancedSQLClient</artifactId>
<version>Version</version>
</dependency>
```

> Documentation soon!
You can add AdvancedSQLClient to your build path using Maven or Gradle. You can also shade&relocate it using shade plugin to have it's unique build path.

<a href="https://github.com/ZorTik/AdvancedSQLClient/wiki/Installation">Installation on Wiki</a>

> Wiki in progress!
1 change: 1 addition & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repositories {
}

dependencies {
implementation project(":shared")
implementation group: 'org.jetbrains', name: 'annotations', version: '20.1.0'
implementation 'com.google.code.gson:gson:2.9.0'
compileOnly 'org.projectlombok:lombok:1.18.24'
Expand Down
2 changes: 2 additions & 0 deletions api/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include ":shared"
project(":shared").projectDir = file("../shared")
2 changes: 1 addition & 1 deletion api/src/main/java/me/zort/sqllib/api/Executive.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

public interface Executive {

SQLDatabaseConnection getConnection();
SQLConnection getConnection();

}
4 changes: 4 additions & 0 deletions api/src/main/java/me/zort/sqllib/api/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ default Query getAncestor() {
return this;
}

default boolean isAncestor() {
return getAncestor() == this;
}

}
84 changes: 0 additions & 84 deletions api/src/main/java/me/zort/sqllib/api/SQLDatabaseConnection.java

This file was deleted.

11 changes: 11 additions & 0 deletions api/src/main/java/me/zort/sqllib/api/StatementFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package me.zort.sqllib.api;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public interface StatementFactory<T extends Statement> {

T prepare(Connection connection) throws SQLException;

}
4 changes: 4 additions & 0 deletions api/src/main/java/me/zort/sqllib/api/data/QueryResult.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package me.zort.sqllib.api.data;

import org.jetbrains.annotations.Nullable;

public interface QueryResult {

boolean isSuccessful();
@Nullable
String getRejectMessage();

}
16 changes: 15 additions & 1 deletion api/src/main/java/me/zort/sqllib/api/data/QueryRowsResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,27 @@

import java.util.ArrayList;

@Getter
public class QueryRowsResult<T> extends ArrayList<T> implements QueryResult {

@Getter
private final boolean successful;
private String rejectMessage = null;

public QueryRowsResult(boolean successful) {
this(successful, null);
}

public QueryRowsResult(boolean successful, String rejectMessage) {
this.successful = successful;
rejectMessage(rejectMessage);
}

public QueryRowsResult<T> rejectMessage(String message) {
if (rejectMessage != null)
throw new RuntimeException("Reject message is already set!");

this.rejectMessage = message;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Serves as definitive identity of entity id field.
* This is useful if you have different PrimaryKey than
* you want to use as id in {@link me.zort.sqllib.api.repository.SQLTableRepository},
* you want to use as id in SQLTableRepository,
* otherwise a {@link PrimaryKey} is used as ID.
*/
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package me.zort.sqllib.internal.exception;

import lombok.Getter;
import me.zort.sqllib.api.SQLConnection;

public class InvalidConnectionInstanceException extends RuntimeException {

@Getter
private final SQLConnection invalid;

public InvalidConnectionInstanceException(SQLConnection invalid) {
super(String.format("Invalid connection instance %s!", invalid.getClass().getName()));
this.invalid = invalid;
}
}
111 changes: 0 additions & 111 deletions api/src/main/java/me/zort/sqllib/internal/query/QueryPart.java

This file was deleted.

Loading