DEV Community

Cover image for SQLite Rocks and Here's Why

SQLite Rocks and Here's Why

Paul Lefebvre on October 30, 2017

Here are some reasons why you should be using SQLite with your apps: It is fast SQLite is an embedded database so the database engine g...
Collapse
 
lobsterpants66 profile image
Chris Shepherd

"But you can stick text data into an integer column without a problem."

OK, I give up - why would that be an advantageous thing?
I'm pretty sure my app would crash horribly if I started getting strings in my ints.

Collapse
 
lefebvre profile image
Paul Lefebvre • Edited

If you want to use SQLite as more of a datastore, perhaps to back a dictionary then the data type flexibility would be very useful.

If you are using it as a simple traditional database, I agree it is far less useful.

Collapse
 
ssteinerx profile image
Steve Steiner

Don't forget: Apple's Core Data is also backed by SQLite.

Collapse
 
orask profile image
Oras Al-Kubaisi

Thanks a lot for sharing this post. I didn't know that SQLite was used in production. I used it for testing locally in dev environments.

Collapse
 
engineercoding profile image
Wesley Ameling

I actually encountered an issue with this. I updated a migration once to have a char(8) and accidentally updated a field to a string with 9 characters. Locally testing it with SQLite threw no errors, but on the CI my tests were failing and I couldn't figure out why.

Personal lesson learned: use the same rdbms as on production while testing.

Collapse
 
dmerejkowsky profile image
Dimitri Merejkowsky • Edited

It works great for this use case but it also works well in production.

It's also used pretty often for mobile apps.

And, in case you never read it, you might enjoy How SQLite is tested :)

Collapse
 
isularifin profile image
isul

wow. i think i must use sqlite

Collapse
 
kayis profile image
K

I read it got much of its funding by aerospace companies. That's why SQLite has a humongous amount of tests.