How can I preload data in my Play Framework project using CSV Files

47 views
Skip to first unread message

roth.st...@gmail.com

unread,
Feb 13, 2018, 7:57:17 AM2/13/18
to Play Framework
Hey,

Is it still possible to preload Data in my Play Framework project? Preferably I would want to do that using CSV Files.

Can this be done? And if so, how?

Best Regards

Greg Methvin

unread,
Feb 14, 2018, 7:21:48 AM2/14/18
to Play Framework
There's no Play-specific thing for doing it. Of course it can be done, but how depends on where you store your data and how you want it to be loaded.

If you're using a relational database, you can generate a bunch of SQL INSERT statements from the CSV file. A quick Google brings up a stack overflow post about it: https://stackoverflow.com/questions/8213/generate-insert-sql-statements-from-a-csv-file. That could be copied to one of your evolutions files.
Reply all
Reply to author
Forward
0 new messages