开发者

Rails: Proper work flow to shred XML data into relational SQL database

开发者 https://www.devze.com 2022-12-19 09:44 出处:网络
I have a Rails project and I used Migrations to setup the database schema (I\'m using sqlite3). 开发者_运维百科I have a XML file that I want to insert into my database. What\'s the best way to approac

I have a Rails project and I used Migrations to setup the database schema (I'm using sqlite3). 开发者_运维百科I have a XML file that I want to insert into my database. What's the best way to approach this? I'm thinking there's some Ruby script that I can write once and use to parse the XML file and insert it into my database, but intuitively it feels like this is a common problem and should have already been automated in the Ruby/Rails world. I guess some people would call this XML shredding, but querying Google hasn't turned up much for me.

Any thoughts?


db/seeds.rb could be a good place to put the data.

0

精彩评论

暂无评论...
验证码 换一张
取 消