Announcement Announcement Module
Collapse
No announcement yet.
Where is data stored? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Where is data stored?

    I know this sounds like a complete newb question but I am a complete newb so bear with me!

    I recently tried to import legacy data into a dev project. What I found out is that a little knowledge is a dangerous thing and I manged to obliterate my entire database. Thanks to Burt Beckwith's help I was able to get my app up and running again but I fear the data stored in my devDb is gone for good.

    After getting my app up and running again I looked at my devDb.script (which was previously blank) and noticed all of the Create Table and Insert Into statements to recreate my database.

    Can this file be used to insert bootstrap or lookup data? I can get my legacy data in excel or as sql insert statements. What is the best method for a one time load of this data?

    Thanks

  • #2
    You can use SQL insert statements as long as they are supported by your database. I would search for "Grails batch updates" to find out more information, but basically you can inject the 'dataSource' bean and use that to perform the JDBC access. Some use the groovy.sql.Sql class for that, but I'm sure there are other options. It may be worth asking this on the Grails user mailing list.

    Comment

    Working...
    X