Skip to content

v3.0.0-alpha.9 | H2 DB, blocking database, improved query logging and service injection

Pre-release
Pre-release
Compare
Choose a tag to compare
@freya022 freya022 released this 03 Dec 15:19
· 709 commits to 3.X since this release
ce8f639

Overview

Added H2 database support, blocking database and buildable components for Java users, reworked query logging and improved service injection with lazy and list of interfaced services.

Note: The wiki has now moved to https://freya022.github.io/BotCommands/3.X

Don't hesitate to check out the changelogs as they contain more details.

Fixes

  • Fixed inexistant application commands map when BApplicationConfig#slashGuildIds was used (Commit)
  • Fixed Event#getRawData not returning anything
  • Fixed component timeouts not being retrievable when no handler was added
  • Fixed component timeout handlers not having user data passed through (#137)
  • Fixed Java type matching for parameter resolver factories (Commit)
  • Reply with "Application commands not available" message if a command is not found, and global applications are not registered. (Commit)
    • This happens if a global command tries to be executed, when global commands failed to update on startup
  • Fixed name of requested services not being taken into account (Commit)
  • Fix unknown component filters by preventing usage of anonymous component filters (Commit)

Changes

  • Moved Logging to core package
  • Replaced emoji-java with JEmojis (#132)
    • This removes the org.json dependency and updates jackson-databind to 2.16.0
    • Fixes issues with emoji indexes and incorrect fitzpatrick formats
  • Require @DevConfig opt-in on BApplicationConfig#forceGuildCommands
  • Allow calling DBResult's Iterator#hasNext more than once
  • Reworked query logging (#133)
    • Allows adding RDBMS-specific parametrized queries, as to provide the most accurate executable queries
    • Connections made with (Blocking)Database transparently return traced connections and prepared statements
    • Prepared statements are logged by using the class which created it, this means that your logger level for the class itself must be on TRACE
    • Prepared statements can have their loggers changed manually, this is only useful if the logger's name cannot be retrieved using the execution stack, see Database for more details on tracing
  • BConfig#logQueries is now disabled by default
    • This is done as to avoid accidental logging, now that the logger is the caller class
  • Java users can now use use a builder pattern when creating components, similar to V2
  • Allow null in persistent handlers / timeouts user data (#137)
  • Separated database configs in a database block (Commit)

Additions

  • Added a message when applications commands are not registered yet
  • Added BlockingDatabase for Java users (#133)
  • Added the ability to read generated keys (Commit)
  • Added support for primitive arrays when setting statement parameters (Commit)
  • Added missing lazy overloads on ServiceContainer (Commit)
  • Added support for Lazy and List when injecting services
    • Lazily injected services can have their element type nullable (#141)
  • Added support for H2 database (#139)
    • Requires PostgreSQL compabitility mode, see ConnectionSupplier for more details
    • This allows you to run an in-memory database, or have it saved to a file, see H2 Database connection modes for details
    • Flyway users: Due to required migration script changes, the bc schema needs to be deleted, other solutions include changing the checksum or using Flyway#repair, with their own caveats
  • Allow unresolvable services on optional parameters (Commit)
  • Added ServiceContainer#canCreateService overload for named services

Removals

  • Removed deprecated interaction filtering methods

Full Changelog: v3.0.0-alpha.8...v3.0.0-alpha.9