Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - Spreadsheet adapter

Is there a way to use an Excel spreadsheet "as the database" adapter? Instead of writing anything to sqlite3, PostgreSQL, or MySQL, etc. I want to be able to read and write directly to an Excel spreadsheet.

Sqlite3 is just a file system right? Has anyone created an adapter to just use .xls or even .xlsx instead of .sqlite?

I also understand that if it doesn't exist already, this would probably be difficult to create. I'm not sure how it would work, but that's not the point of this question.

like image 543
ardavis Avatar asked Jun 19 '26 12:06

ardavis


1 Answers

One could use the spreadsheet gem to store/retrieve data from an Excel document, and then mix in the required ActiveModel modules required to make it behave like ActiveRecord. Be sure to use ActiveModel::Lint to ensure that you've implemented the ActiveRecord "interface" correctly.

like image 186
Eonflare Avatar answered Jun 21 '26 00:06

Eonflare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!