13

I'm writing an application for learning foreign words of exactly one language (english at the moment), which has currently an ineffective design.

I use Java and SQLite-jdbc for saving the words. After starting, the application downloads a comma separated wordlist and inserts each value pair into the Database. I hosted the wordlist on an extra github repository, because i thought I shouldn't store the database file inside the development git repository - its binary, so everytime I do sth with the database, the hash of the database file will change. I don't like that, because then Id have to create unreadable commit messages, and the actual change to the database would be hard to understand.

Therefore my actual question: Is there a more elegant solution of saving the DB file than saving it inside the git repo? Should I simply store the current database file on another filehost? What are the best practices for such a situation?

asked May 28, 2016 at 20:05

1 Answer 1

23

Store the words using a text format, and build a database during the build.

Instead of storing the information in binary format and storing the binary file in the version control, keep the pairs in a CSV file. This allows you to easily change it, commit the changes and, later, diff the changes with ease.

Later, when you actually need this data in a database, do a bulk insert from the CSV file. This can be done during a build or deployment. By the way, SQLite has a feature which makes it possible (and more importantly fast) to import data from CSV files.

answered May 28, 2016 at 20:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.