Skip to content
/ SQL Public

SQL library for Spigot. Replacement for Ebean.

License

Notifications You must be signed in to change notification settings

StarTux/SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL

MySQL library for Spigot. Replacement for Ebean.

Usage

Client plugins need SQL as a dependency. They must then create an instance of SQLDatabase, register table classes, and at least once call generateAllTables().

@Override
public void onEnable() {
    database = new SQLDatabase(this);
    database.registerTables(UserTable.class, ScoreTable.class);
    database.createAllTables();
}

Configuration

There is a global configuration in this plugin's database section in the config.yml file, but individual plugin may override any setting in the root section of the sql.yml file in their respective plugin folders.

host: '127.0.0.1'
port: '3306'
user: 'user'
password: 'password'
database: ''
prefix: ''

Annotations

Table classes can and should be described with annotations. This plugin respects the following annotations of the javax.persistence package. All of them are shaded in to the plugin jar.

  • Column
  • Id
  • Index
  • OneToMany
  • Table
  • UniqueConstraint

About

SQL library for Spigot. Replacement for Ebean.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages