forked from Limework/skript-db
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8864ed4b30 | ||
|
|
b815f50cf2 | ||
|
|
310536c085 | ||
|
|
4499355148 | ||
|
|
131ab77c91 | ||
|
|
db5174508f | ||
|
|
4cc0d0ba4e | ||
|
|
6e1e3ce14b | ||
|
|
aa65a4e7e8 | ||
|
|
d00fc2b6a0 | ||
|
|
a72da39839 | ||
|
|
d98bc34b38 | ||
|
|
ce64eda9e2 | ||
|
|
d9f95ac101 | ||
|
|
fbb35937e6 | ||
|
|
852e5e0477 | ||
|
|
7620da85f1 | ||
|
|
e3a6cc1fca | ||
|
|
678d6d49d8 | ||
|
|
7227496c1c | ||
|
|
1ad3813c73 | ||
|
|
619a6831e5 | ||
|
|
7e444ed0ca | ||
|
|
c7766fe11f | ||
|
|
e18cd3d28c | ||
|
|
280a0cb38d | ||
|
|
3473007bd6 | ||
|
|
59d209540b | ||
|
|
3e7cf7a6dd | ||
|
|
185a324e8c | ||
|
|
e75941d75a | ||
|
|
efa37217c2 | ||
|
|
0d8d834929 | ||
|
|
b2a53078a6 | ||
|
|
83f71e147b | ||
|
|
e610fc1357 | ||
|
|
aa1a1d14c7 | ||
|
|
3a1ec76a0b | ||
|
|
2eb691cd69 | ||
|
|
6dbd2effb3 | ||
|
|
88b76f1b5b | ||
|
|
b692047878 | ||
|
|
3e57cae866 | ||
|
|
1e95b818eb | ||
|
|
688ea9d46b | ||
|
|
dd6d574479 | ||
|
|
1f6091eb95 | ||
|
|
74d4918f44 |
19
README.md
19
README.md
@@ -5,17 +5,11 @@
|
||||
|
||||
### Difference from original skript-db
|
||||
- Fixed local variables disappearance in newer Skript versions (very hacky fix, but it works, so that's good!)
|
||||
- Thread-pool size is now automatically increasing on demand with use of CachedThreadPool, instead of a fixed hard-coded number
|
||||
- Uses newer versions of dependencies (Increased performance and security)
|
||||
- Thread-pool size is now automatically increasing on demand to use of CachedThreadPool, instead of a fixed hard-coded number
|
||||
- Uses a newer version of HikariCP
|
||||
- Only meant to be used by newer Minecraft versions (1.8 is not supported)
|
||||
- Replaced `synchronously execute` with `quickly execute`, which allows to speed up queries by 50ms with some risk
|
||||
- SQL Driver is configurable
|
||||
- A few variable type related bugs fixed
|
||||
- Uses Java 11 instead of Java 8
|
||||
|
||||
### Installation
|
||||
1. Use Skript 2.5+
|
||||
2. Use Java 11+
|
||||
3. Put skript-db in plugins folder and restart the server
|
||||
### Expression `Data Source` => `datasource`
|
||||
Stores the connection information for a data source. This should be saved to a variable in a
|
||||
`script load` event or manually through an effect command.
|
||||
@@ -84,10 +78,3 @@ execute unsafe {fully dynamic query} in {sql}
|
||||
```
|
||||
|
||||
---
|
||||
### Configuration
|
||||
plugins/skript-db/config.yml
|
||||
```
|
||||
# Only change this if you wish to use a different driver than Java's default, like MariaDB driver.
|
||||
# If you use MariaDB, its driver is shaded together with skript-db, so you can just specify: "org.mariadb.jdbc.Driver"
|
||||
sql-driver-class-name: "default"
|
||||
```
|
||||
12
pom.xml
12
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.btk5h</groupId>
|
||||
<artifactId>skript-db</artifactId>
|
||||
<version>1.3.5</version>
|
||||
<version>1.3.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<repositories>
|
||||
@@ -45,8 +45,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
@@ -81,7 +81,7 @@
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<version>5.0.1</version>
|
||||
<version>4.0.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -93,14 +93,14 @@
|
||||
<dependency>
|
||||
<groupId>com.github.SkriptLang</groupId>
|
||||
<artifactId>Skript</artifactId>
|
||||
<version>2.6-beta3</version>
|
||||
<version>2.6-alpha1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<version>3.0.3</version>
|
||||
<version>2.7.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -10,14 +10,10 @@ import com.btk5h.skriptdb.SkriptDB;
|
||||
import com.btk5h.skriptdb.SkriptUtil;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import javax.sql.rowset.CachedRowSet;
|
||||
import javax.sql.rowset.serial.SerialBlob;
|
||||
import javax.sql.rowset.serial.SerialException;
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSetMetaData;
|
||||
@@ -303,21 +299,6 @@ public class EffExecuteStatement extends Effect {
|
||||
}
|
||||
|
||||
private void setVariable(Event e, String name, Object obj) {
|
||||
|
||||
//fix mediumblob and similar column types, so they return a String correctly
|
||||
if (obj != null) {
|
||||
if (obj.getClass().getName().equals("[B")) {
|
||||
obj = new String((byte[]) obj);
|
||||
|
||||
//in some servers instead of being byte array, it appears as SerialBlob (depends on mc version, 1.12.2 is bvte array, 1.16.5 SerialBlob)
|
||||
} else if (obj instanceof SerialBlob) {
|
||||
try {
|
||||
obj = new String(((SerialBlob) obj).getBinaryStream().readAllBytes());
|
||||
} catch (IOException | SerialException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Variables.setVariable(name.toLowerCase(Locale.ENGLISH), obj, e, isLocal);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import ch.njol.skript.lang.SkriptEvent;
|
||||
import ch.njol.skript.lang.SkriptParser;
|
||||
import com.btk5h.skriptdb.events.SQLQueryCompleteEvent;
|
||||
import org.bukkit.event.Event;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
public class EvtSQLQueryComplete extends SkriptEvent {
|
||||
static {
|
||||
@@ -23,7 +24,7 @@ public class EvtSQLQueryComplete extends SkriptEvent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(Event event, boolean debug) {
|
||||
public String toString(@Nullable Event event, boolean debug) {
|
||||
return "complete of sql query";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: skript-db
|
||||
version: 1.3.5
|
||||
version: 1.3.3
|
||||
main: com.btk5h.skriptdb.SkriptDB
|
||||
depend: [Skript]
|
||||
authors: [btk5h, FranKusmiruk, Govindas, TPGamesNL]
|
||||
|
||||
Reference in New Issue
Block a user