How zomarrd/databaseapi_nukkit works
Database API is a NukkitX-facing library for configuring MariaDB/MySQL connections and issuing asynchronous SQL operations with optional callbacks. The principal workflow is plugin code selecting a database type and connection details, initializing the matching implementation, connecting, then querying and handling completion. The core Database class also provides select/insert/update operations. Source excerpts establish the execution and driver behavior; broader behavior is summarized from the README, and no relationships are inferred solely from module names.
Main entry points: DatabaseLib.kt Database factory · Database.kt Database operations · SQLConnectionInfo.java Connection contract · MariaDB.kt MariaDB driver
Components 12
Connection setup
- Database factory
src/main/java/dev/zomarrd/dbapi/DatabaseLib.kt - Database type
src/main/java/dev/zomarrd/dbapi/SQLType.java - Connection contract
src/main/java/dev/zomarrd/dbapi/SQLConnectionInfo.java - MariaDB config
src/main/java/dev/zomarrd/dbapi/mariadb/ConnectionInfo.kt - MySQL config
src/main/java/dev/zomarrd/dbapi/mysql/ConnectionInfo.kt
Database runtime
- MariaDB driver
src/main/java/dev/zomarrd/dbapi/mariadb/MariaDB.kt - MySQL driver
src/main/java/dev/zomarrd/dbapi/mysql/MySQL.kt - Database operations
src/main/java/dev/zomarrd/dbapi/Database.kt - Column-value pair
src/main/java/dev/zomarrd/dbapi/utils/Pair.kt
Query results
- Callback results
src/main/java/dev/zomarrd/dbapi/utils/ResultCallback.kt
Other components
- Plugin code
- SQL server
Connections 19
- Plugin code → Database factory: initializes
README.md - Database factory → Database type: selects type
src/main/java/dev/zomarrd/dbapi/DatabaseLib.kt - Database factory → MariaDB driver: creates
src/main/java/dev/zomarrd/dbapi/DatabaseLib.kt - Database factory → MySQL driver: creates
src/main/java/dev/zomarrd/dbapi/DatabaseLib.kt - Plugin code → MariaDB config: configures
README.md - Plugin code → MySQL config: configures
- MariaDB config → Connection contract: implements
src/main/java/dev/zomarrd/dbapi/mariadb/ConnectionInfo.kt - MySQL config → Connection contract: implements
src/main/java/dev/zomarrd/dbapi/mysql/ConnectionInfo.kt - Database factory → Connection contract: accepts info
src/main/java/dev/zomarrd/dbapi/DatabaseLib.kt - Plugin code → Database operations: connects
README.md - Plugin code → Database operations: queries
README.md - MariaDB driver → Connection contract: reads URL
src/main/java/dev/zomarrd/dbapi/mariadb/MariaDB.kt - MySQL driver → Connection contract: reads URL
src/main/java/dev/zomarrd/dbapi/mysql/MySQL.kt - MariaDB driver → SQL server: connects
src/main/java/dev/zomarrd/dbapi/mariadb/MariaDB.kt - MySQL driver → SQL server: connects
src/main/java/dev/zomarrd/dbapi/mysql/MySQL.kt - Database operations → SQL server: executes SQL
src/main/java/dev/zomarrd/dbapi/Database.kt - Database operations → Column-value pair: uses values
src/main/java/dev/zomarrd/dbapi/Database.kt - Database operations → Callback results: notifies
src/main/java/dev/zomarrd/dbapi/Database.kt - Callback results → Plugin code: returns result
README.md