Skip to content
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

Customizable table prefix #1277

Closed
NotMyFault opened this issue Apr 11, 2020 · 1 comment · Fixed by #1278
Closed

Customizable table prefix #1277

NotMyFault opened this issue Apr 11, 2020 · 1 comment · Fixed by #1278
Assignees
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Enhancement Improvement or modification which is usually a new feature.
Milestone

Comments

@NotMyFault
Copy link
Contributor

Description

Is your feature request related to a problem?

No

Describe the solution you'd like us to implement.

The ability to customize the table prefix used for BentoBox databases is something that can be handy if you have multiple servers and want to store bento's data in 1 db rather than in several ones.
That way it simply wouldn't clash with existing tables.

Describe alternatives you've considered.

/

Additional context

/

@tastybento tastybento self-assigned this Apr 12, 2020
@tastybento tastybento added the Type: Enhancement Improvement or modification which is usually a new feature. label Apr 12, 2020
@tastybento
Copy link
Member

I've made a branch that supports this. However, there is a problem - the table name length size can only by up to 64 characters (and for Postgresql 63 characters because it null terminates). There is currently one addon that goes all the way to 63 and that is Control Panel because it's canonical name is world.bentobox.controlpanel.database.objects.ControlPanelObject. Therefore, there is room for only 1 character. I have updated the docs on the Database API to highlight this limitation, but for the sake of compatibility, I'm limiting the prefix to 1 character. This should still give you plenty of potential instances!

For future, I'm going to keep my database objects in packages with shorter names.

@tastybento tastybento added this to the 1.13.0 milestone Apr 12, 2020
@Poslovitch Poslovitch added the Status: In progress Working on the issue. label Apr 15, 2020
@Poslovitch Poslovitch linked a pull request Apr 15, 2020 that will close this issue
tastybento added a commit that referenced this issue Apr 18, 2020
* Adds a single character prefix to database tables

#1277

* Fix tests

* Fix bug with substring
@Poslovitch Poslovitch added Status: Done This issue has been completed or answered. This pull request has been merged. and removed Status: In progress Working on the issue. labels Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Enhancement Improvement or modification which is usually a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants