Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I was implementing Carrierwave with possibility to upload multiple files, so according to this source Add more files and remove single file Carrierwave tutorial I had to create a migration to add empty array to the database, like this:

add_column :products, :tags, :string, array: true, default: []

Since I was using Sqlite3, I faced an issue - it didint let me store array into the db. I tried few things, like to store that array as a string:

default: [].join(",")

and then change it from controller, but still couldn't find suitable solution. Then I gave up and switched Sqlite3 to pg database. Looks like all it is all fine now - migration went well. So now I am using pg database in both - development and production environments. But since I am newby on these things I am afraid for future fails. So my questions:

  1. Do you think its ok to use pg db in development env?
  2. What is the mainreason to use Sqlite3 - only the ease of configuration?
  3. Any advises, thoughts on this topic very welcome.

Many thanks!

share|improve this question
2  
Opinion-based questions like this aren't really suited to Stack Overflow, so I've voted to close, but that said, you should never use SQLite3 for anything, in my opinion. It's not production-viable, and you should always develop with the same DB as production. It's the default because it doesn't require a server and it's easy to bootstrap, but no one really uses it for anything serious. – Jim Stewart 20 hours ago
    
ok, that made my horizon wider. Thanks – J.D. 20 hours ago
2  
Re 1) yes, absolutely. In fact I strongly recommend to use the same DBMS for development, test and production. – a_horse_with_no_name 20 hours ago
    
@JimStewart "Think of SQLite not as a replacement for Oracle but as a replacement for fopen()". Yes, SQLite probably won't make a good business database, but it is not completely useless. Web browsers use SQLite for things like bookmarks and browsing history to great effect. – Colonel Thirty Two 16 hours ago
    
Yeah, I was being too mean to it; it's very handy for self-contained deployments of large apps that want an internal SQL DB. – Jim Stewart 16 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.