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

Allow for resource-sqlite conversions #106

Open
feefladder opened this issue Nov 14, 2022 · 2 comments
Open

Allow for resource-sqlite conversions #106

feefladder opened this issue Nov 14, 2022 · 2 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@feefladder
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Editing a database by hand is cumbersome for people that may want to work on my project, and therefore I put all my data in .tres resource files. I am now thinking of moving to SqLite. However, to do this manually costs a lot of work and I have already made a nice, well-thought of data structure with the resource files.

Describe the solution you'd like

A script/set of scripts to:

  1. create database tables from existing definitions of resources
  2. populate the tables from existing .tres files
  3. (lower priority) convert the tables (whenever updated) back to a collection of .tres files

Describe alternatives you've considered

This may or may not be within the scope of this plugin. I have considered making a plugin/set of scripts myself for this, but am a bit low on resources, so may not have time for it in the future.

Additional context

image
image

@feefladder feefladder added the enhancement New feature or request label Nov 14, 2022
@2shady4u
Copy link
Owner

This would be an interesting addition, but I currently don't have time to work on this 😞

Just a heads-up that the SQLite plugin already allows you to import and export databases from JSON files 👀

@2shady4u 2shady4u added the wontfix This will not be worked on label Dec 31, 2022
@feefladder
Copy link
Contributor Author

I have made something that works, albeit not the most beautiful code (I did not know how to get property lists of builtin types, so hardcoded them...)
creating a table: https://github.com/feefladder/ahf/blob/f3cb3e263902f4de70d54b2ef3a792ed5ebf1600/scripts/controllers/initializer.gd#L129

adding a row from the table: https://github.com/feefladder/ahf/blob/f3cb3e263902f4de70d54b2ef3a792ed5ebf1600/scripts/controllers/initializer.gd#L141

It does require that the get_class method is overridden for the resource, so a table is made with the resource name. this should be solved with godotengine/godot#62273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants