GithubHelp home page GithubHelp logo

aikar / db Goto Github PK

View Code? Open in Web Editor NEW
68.0 4.0 20.0 166 KB

Aikar's Intuitive JDBC Database Wrapper - A clean and intuitive API for Java to remove JDBC boilerplate.

Home Page: https://idb.emc.gs

License: MIT License

Java 100.00%

db's Introduction

IDB - Intuitive Database Wrapper

This is my JDBC Database Wrapper, with the intent on providing a clean intuitive API, for access to a JDBC database,

IDB handles connections, query, execution, result fetching and data return for all the common access operations without the boilerplate of making all of the JDBC API's yourself.

Most Database operations can be completed in a single API call.

Built currently on top of Hikari Connection Pool.

Getting Started

Version: 1.0.0-SNAPSHOT

Project Setup: Maven, Gradle

Getting Started: Using IDB

API Documentation: IDB API

Real World Examples: Examples

Say Thanks

If this library has helped you, please consider donating as a way of saying thanks

PayPal Donate

Why does it require Java 8+?

Get off your dinosaur and get on this rocket ship!

Dinosaurs have been dead for a long time, so get off it before you start to smell.

Download Java 8

Java Docs

TODO

Contributing

See Issues section.

Join #aikar on Spigot IRC - irc.spi.gt to discuss.

Or Code With Aikar Discord.

Other projects by Aikar / Empire Minecraft

  • ACF - Powerful Java Command Framework
  • TaskChain - Powerful context control to dispatch tasks Async, then access the result sync for API usage. Concurrency controls too.
  • Minecraft Timings - Add Timings to your plugin in a safe way that works on all Bukkit platforms (CraftBukkit - no timings, Spigot - Timings v1, Paper and Paper forks - Timings v2)

License

As with all my other public projects

IDB (c) Daniel Ennis (Aikar) 2014-2018.

IDB is licensed MIT. See LICENSE

db's People

Contributors

aikar avatar broccolai avatar chickeneer avatar mtm123 avatar roinujnosde avatar sgdc3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

db's Issues

Use supported Language annotations

The language in @Language annotations is not MySQL but rather just SQL in IntelliJ. As it stands, the annotations are useless to IntelliJ users (which is the IDE they were made for, or so I assume due to the org.intellij.lang.annotations package) as MySQL is not a recognised language.

DBRow Boolean

Could be possible to add for DBRow to get a boolean value? It could save a lot of time while coding a project.

But still thanks Aikar for the great and simple db tool to use.

Restructure project to core/bukkit

Remove all bukkit refs from core folder and move them into a bukkit module

Timings API needs a generic interface in core/ that implements same methods as minecraft-timings, then the bukkit binding passes in a timing provider or so.

Project Name

Need a real name that isn't ADB

Open to a 'unique' name.

SUGGESTIONS! (no joke submissions, they will be deleted)

Add nullability annotations to entire project

I've recently started using idb religiously in my Kotlin projects. Kotlin uses forced nullability and it respects Java (and co.) annotations for nullability and handles it appropriately to force them in the language. It is therefore best for Kotlin users, and standard Java users alike where the IDE can help, to add nullability (@NotNull/@Nullable) wherever possible.

Push new version

After 561381e which fixes a critical bug, dependents are still left to rot on an older HikariCP version due to no newer version of this library. Pushing a new version fixes this.

MariaDB Wont work with Recommended Options

When using recommend options, MariaDB will not work due to:

[01:50:16 ERROR]: [com.zaxxer.hikari.util.PropertyElf] Property cacheCallableStmts does not exist on target class org.mariadb.jdbc.MariaDbDataSource

Which is set here:

https://github.com/aikar/db/blob/master/core/src/main/java/co/aikar/idb/HikariPooledDatabase.java#L38

To resolve this, I manually changed the DSN in my code to start with mariadb:// which skips where it's being set here:

https://github.com/aikar/db/blob/master/core/src/main/java/co/aikar/idb/HikariPooledDatabase.java#L33

but it seems here:

https://github.com/aikar/db/blob/master/core/src/main/java/co/aikar/idb/DatabaseOptions.java#L63

Is expected MariaDB to work like MySQL. I can only assume something is missing in MariaDB or not implemented.

Error when enabling DB using PooledDatabaseOptions

Hello!

I am having error when enabling DB. After DB - Starting... and DB - Start completed., hikari (I guess) threw stacktrace:

java.lang.IllegalStateException: The configuration of the pool is sealed once started.  Use HikariConfigMXBean for runtime changes.
        at com.zaxxer.hikari.HikariConfig.setTransactionIsolation(HikariConfig.java:965) ~[?:?]
        at co.aikar.idb.HikariPooledDatabase.<init>(HikariPooledDatabase.java:57) ~[?:?]
        at co.aikar.idb.PooledDatabaseOptions$PooledDatabaseOptionsBuilder.createHikariDatabase(PooledDatabaseOptions.java:10) ~[?:?]

DB enabling in onEnable().
I did everything that listed in Using IDB -> PooledDatabaseOptions.
Updating HikariCP or not shading doesn't change anything.

I am using (maven):

  • Spigot 1.12.2-R0.1-SNAPSHOT
  • HikariCP 2.4.1
  • IDB-Core 1.0.0-SNAPSHOT

Use SLF4J

What the title says, use SLF4J API for logging instead of java.util.logging

Regression for more recent mysql connectors

This is basically a regression from PaperMC/Paper#5473
and also kinda explained/regressed in NiklasEi/gamebox#87

Basically
if (dataSourceClassName == null) tryDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
needs an additonal statement for com.mysql.cj.jdbc.MysqlDataSource

Relevant stacktrace:

java.lang.IllegalArgumentException: either dataSource or dataSourceClassName is required
        at com.zaxxer.hikari.HikariConfig.validate(HikariConfig.java:771) ~[?:?]
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:69) ~[?:?]
        at co.aikar.idb.HikariPooledDatabase.<init>(HikariPooledDatabase.java:56) ~[?:?]
        at co.aikar.idb.BukkitDB.createHikariDatabase(BukkitDB.java:34) ~[?:?]
        at co.aikar.idb.BukkitDB.createHikariDatabase(BukkitDB.java:30) ~[?:?]
        at co.aikar.idb.BukkitDB.createHikariDatabase(BukkitDB.java:26) ~[?:?]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.