Database-API 1.3

Asynchronous database api for spigot

  1. IngotStudios
    Native Minecraft Version:
    Legacy (< 1.13)
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://github.com/IngotStudios/async-database-api
    Contributors:
    Yassino, gusosasi
    This is an asynchronous database API which allows using MongoDB and MySQL asynchronously on Spigot.
    In the config you can set which database should be in use.
    Possible database types are "MONGODB" or "MYSQL"

    MongoDB:
    Code (Text):

    Get DatabaseHandler instance
    MongoDatabaseHandler databaseHandler = databaseService.getMongoDatabaseHandler();

    Get single `Document`
    Document mongoDocument = databaseHandler.getAsyncModel("CollectionName", Filters.eq("UUID", player.getUniqueId().toString()));

    Get `List` of `Document`
    List<Document> mongoDocumentList = databaseHandler.getAsyncModels("CollectionName");

    Insert `Document`
    Document mongoDocument = new Document();
    mongoDocument.put("UUID", player.getUniqueId().toString());
    databaseHandler.insertModel("CollectionName", mongoDocument);

    Update `Document`
    Document mongoDocument = new Document();
    mongoDocument.put("UUID", player.getUniqueId().toString());
    mongoDocument.put("Kills", 10);
    databaseHandler.updateModel("CollectionName", Filters.eq("UUID", player.getUniqueId().toString()), mongoDocument);

    databaseHandler.deleteModel("CollectionName", Filters.eq("UUID", player.getUniqueId().toString()));

     


    MySQL:
    Code (Text):


    Get DatabaseHandler instance
    MySQLDatabaseHandler databaseHandler = databaseService.getMySQLDatabaseHandler();

    Get single `ResultSet`
    String queryStatement = "SELECT * FROM `player_stats`";
    ResultSet resultSet = databaseHandler.getAsyncModel(queryStatement);

    Get `List` of `ResultSet`
    String queryStatement = "SELECT * FROM `player_stats`";
    List<ResultSet> resultSetList = databaseHandler.getAsyncModels(queryStatement);

    Execute Insert-Statement
    String insertStatement = "INSERT INTO `player_stats` (`UUID`, `KILLS`, `DEATHS`) VALUES ('" + player.getUniqueId.toString() + "', '0', '0')";
    databaseHandler.insertModel(insertStatement);

    Execute Update-Statement
    String updateStatement = "UPDATE `player_stats` SET `KILLS`='" + kills + "' WHERE `UUID`='" + player.getUniqueId.toString() + "'";
    databaseHandler.updateModel(updateStatement);

    Execute Delete-Statement
    String deleteStatement = "DELETE FROM `player_stats` WHERE `UUID`='" + player.getUniqueId.toString() + "'";
    databaseHandler.deleteModel(updateStatement);

     



    [​IMG]



    If you need any help you can contact us at https://discord.com/invite/9H4wxG9yBc
    Mist_Zep likes this.

Recent Updates

  1. Wrong version
  2. New Version
  3. Update

Recent Reviews

  1. PlaceLikeHell
    PlaceLikeHell
    5/5,
    Version: 1.3
    Eine gute DatenbankAPI, ich verwende diese tatsächlich immer noch obwohl ich am Anfang Sorgen hatte, dass diese Bugs enthält aber ich kann Sie jedem weiter empfehlen!
  2. joky
    joky
    5/5,
    Version: 1.1
    Echt gutes Plugin, funktioniert sehr gut habe bisher noch keine Probleme gehabt.
  3. letzYassineTvYT
    letzYassineTvYT
    5/5,
    Version: 1.1
    Easy to use API, great work!
    ----------------------------------------------------------------------------
  4. haltiq
    haltiq
    5/5,
    Version: 1.1
    Very good API. Works perfect!

    -------------------------------------------------------