Skip to content

GH-979 GH-1049 2.0/postgres ready and persister change #1050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

P1otrulla
Copy link
Member

@P1otrulla P1otrulla commented Jul 14, 2025

TAK zmiana floatu na int wspiera wcześniejsze wpisy w bazie jako float

@P1otrulla P1otrulla requested a review from a team as a code owner July 14, 2025 20:37
Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

Walkthrough

This update fixes the PostgreSQL connection URL to include the database name, ensuring proper connection setup. It changes location saving to use block coordinates instead of exact positions. The ignore list's internal database class was renamed and its ID field annotation adjusted. Several other internal ORM classes were renamed from "Wrapper" to "Table" for consistency, and import paths were corrected. No public-facing method signatures or logic flows were changed.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 683e05b and 0ea9053.

📒 Files selected for processing (10)
  • eternalcore-core/src/main/java/com/eternalcode/core/database/AbstractRepositoryOrmLite.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/automessage/AutoMessageRepositoryOrmLite.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/home/database/HomeRepositoryOrmLite.java (4 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/home/database/HomeTable.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/ignore/IgnoreRepositoryOrmLite.java (8 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/jail/PrisonerRepositoryOrmLite.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/jail/PrisonerTable.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageRepositoryImpl.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatStateRepositoryOrmLite.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatStateTable.java (1 hunks)
✅ Files skipped from review due to trivial changes (6)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageRepositoryImpl.java
  • eternalcore-core/src/main/java/com/eternalcode/core/database/AbstractRepositoryOrmLite.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatStateTable.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/jail/PrisonerRepositoryOrmLite.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/jail/PrisonerTable.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/home/database/HomeTable.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/ignore/IgnoreRepositoryOrmLite.java
🧰 Additional context used
🧠 Learnings (3)
eternalcore-core/src/main/java/com/eternalcode/core/feature/automessage/AutoMessageRepositoryOrmLite.java (1)
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-api/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggle.java:10-11
Timestamp: 2025-01-28T21:35:04.888Z
Learning: Fields in classes used with ORM Lite repository must have package-private (default) access modifier, not private, to allow ORM Lite to access them properly.
eternalcore-core/src/main/java/com/eternalcode/core/feature/home/database/HomeRepositoryOrmLite.java (1)
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-api/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggle.java:10-11
Timestamp: 2025-01-28T21:35:04.888Z
Learning: Fields in classes used with ORM Lite repository must have package-private (default) access modifier, not private, to allow ORM Lite to access them properly.
eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatStateRepositoryOrmLite.java (4)
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-api/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggle.java:10-11
Timestamp: 2025-01-28T21:35:04.888Z
Learning: Fields in classes used with ORM Lite repository must have package-private (default) access modifier, not private, to allow ORM Lite to access them properly.
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggleCommand.java:1-1
Timestamp: 2025-01-30T19:49:57.192Z
Learning: In the EternalCore project's private chat toggle feature, PrivateChatToggleState.ON means messages are blocked, while OFF means messages are allowed.
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggleCommand.java:92-102
Timestamp: 2025-01-28T21:37:36.945Z
Learning: In the EternalCore plugin's private chat feature, PrivateChatToggleState.ON means message blocking is enabled (no messages will be received), while PrivateChatToggleState.OFF means messages are allowed.
Learnt from: Rollczi
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-api/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatState.java:6-16
Timestamp: 2025-02-13T19:26:59.343Z
Learning: In the PrivateChatState enum, ENABLE means private messages are blocked (msgToggle is ON) and DISABLE means private messages are allowed (msgToggle is OFF). The enum values represent the state of the msgToggle feature itself, not the state of receiving messages.
🧬 Code Graph Analysis (2)
eternalcore-core/src/main/java/com/eternalcode/core/feature/automessage/AutoMessageRepositoryOrmLite.java (1)
eternalcore-core/src/main/java/com/eternalcode/core/database/AbstractRepositoryOrmLite.java (1)
  • AbstractRepositoryOrmLite (12-71)
eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatStateRepositoryOrmLite.java (1)
eternalcore-core/src/main/java/com/eternalcode/core/database/AbstractRepositoryOrmLite.java (1)
  • AbstractRepositoryOrmLite (12-71)
🔇 Additional comments (14)
eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatStateRepositoryOrmLite.java (4)

5-5: Import update looks good.

The import path correction aligns with the database package restructuring.


19-19: Table creation updated correctly.

The class name change from PrivateChatStateWrapper to PrivateChatStateTable is consistent with the renaming pattern.


24-27: Database query logic updated properly.

The selectSafe method now uses PrivateChatStateTable.class and the mapping correctly calls PrivateChatStateTable::isEnabled. The default value of PrivateChatState.ENABLE is maintained.


32-32: Save method updated consistently.

The save operation now uses the new PrivateChatStateTable class and constructor, maintaining the same functionality.

eternalcore-core/src/main/java/com/eternalcode/core/feature/automessage/AutoMessageRepositoryOrmLite.java (4)

5-5: Import path updated correctly.

The import statement has been properly updated to reflect the new package location of AbstractRepositoryOrmLite.


33-33: Variable naming improved.

The variable name change from wrapperList to tableList makes the code more readable and aligns with the broader refactoring effort.


41-43: Consistent variable renaming throughout the lambda.

The variable renaming from wrapper to autoMessageTable in the lambda expression is consistent and makes the code easier to understand.


65-66: Variable renaming maintains consistency.

The variable name change from wrapper to autoMessageTable keeps the naming consistent with the rest of the method and improves code clarity.

eternalcore-core/src/main/java/com/eternalcode/core/feature/home/database/HomeRepositoryOrmLite.java (6)

5-5: Import path correction looks good.

The import path has been updated to the correct package location.


28-28: Table creation updated consistently.

The table creation now uses the renamed HomeTable class instead of HomeWrapper.


33-35: ORM operations updated consistently.

All references to HomeWrapper have been properly updated to HomeTable including the conversion method.


60-60: Save operation updated correctly.

The save method now uses HomeTable.from(home) instead of the old wrapper class.


70-71: Delete builder types updated consistently.

The DeleteBuilder generic types have been properly updated to use HomeTable instead of HomeWrapper.

Also applies to: 82-83


1-117: Check LocationPersister for float-to-int handling
HomeTable itself just stores a Location via LocationPersister and doesn’t convert any float fields. Please double-check that your LocationPersister implementation:

  • Reads legacy float-based coordinates
  • Converts them to ints (or rounds appropriately)
  • Preserves backward compatibility for old entries

Verify in:

  • eternalcore-core/src/main/java/com/eternalcode/core/database/persister/LocationPersister.java
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Jul 14, 2025

📦 Development Build Ready

Warning

Do not use this build in production. It is for testing purposes only and may be unstable.

👉 Click here to download the JAR

@P1otrulla P1otrulla self-assigned this Jul 14, 2025
@P1otrulla P1otrulla linked an issue Jul 14, 2025 that may be closed by this pull request
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9439952 and 683e05b.

📒 Files selected for processing (3)
  • eternalcore-core/src/main/java/com/eternalcode/core/database/DatabaseManager.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/database/persister/LocationPersister.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/ignore/IgnoreRepositoryOrmLite.java (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/ignore/IgnoreRepositoryOrmLite.java (2)
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-api/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggle.java:10-11
Timestamp: 2025-01-28T21:35:04.888Z
Learning: Fields in classes used with ORM Lite repository must have package-private (default) access modifier, not private, to allow ORM Lite to access them properly.
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-api/src/main/java/com/eternalcode/core/feature/msgtoggle/MsgToggle.java:7-8
Timestamp: 2025-01-22T22:25:29.027Z
Learning: In the EternalCore project, when a class has a default no-args constructor, avoid making fields final as they need to support initialization through both the default and parameterized constructors.
🔇 Additional comments (1)
eternalcore-core/src/main/java/com/eternalcode/core/database/DatabaseManager.java (1)

74-77: Good fix for PostgreSQL connection URL!

This change properly includes the database name in the PostgreSQL JDBC URL, making it consistent with MySQL and MariaDB configurations. The connection would likely fail without the database name.

@P1otrulla P1otrulla linked an issue Jul 14, 2025 that may be closed by this pull request
@P1otrulla P1otrulla changed the title 2.0/postgres ready and persister change GH-979 GH-1049 2.0/postgres ready and persister change Jul 14, 2025
Copy link
Member

@CitralFlo CitralFlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 2 me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Block#getBlockX instead of Block#getX [DB Persister] Verify PostgreSQL (and other database) support
2 participants