2
Consider SQLite (blog.wesleyac.com)
top 16 comments
sorted by: hot top controversial new old
[-] Yearly1845@reddthat.com 1 points 1 year ago

I love SQLite in the command line. Being able to import data sets into a db that I can quickly write queries for has saved me a lot of data processing time.

That was a good read, thanks!

[-] Sibbo@sopuli.xyz 0 points 1 year ago* (last edited 1 year ago)

From their "code of ethics"

  • First of all, love the Lord God with your whole heart, your whole soul, and your whole strength.
  • Deny oneself in order to follow Christ.
  • Fulfill not the desires of the flesh; hate your own will.

There are even more strange ones, but I hope you get the picture. Reason enough to use something else if possible.

[-] colonial@lemmy.world 1 points 1 year ago

If you actually read the page, it's intended as a tongue-in-cheek box-checker.

This document was originally called a "Code of Conduct" and was created for the purpose of filling in a box on "supplier registration" forms submitted to the SQLite developers by some clients.

This document continues to be used for its original purpose - providing a reference to fill in the "code of conduct" box on supplier registration forms.

[-] robz@toot.robzazueta.com 1 points 1 year ago

@colonial @Sibbo I'm actually glad I did read the page itself - it's clearly satire, making fun of how "sacred" others seem to hold their codes of conduct/ethics. I'm glad I read through that - I see no problems with it or in using SQLite.

[-] kogasa@programming.dev -2 points 1 year ago

It's not satire.

[-] words_number@programming.dev 1 points 1 year ago

Thanks, everyone knows they have a weird coc. It obviously only applies to the maintainers/members of the project though and is more of a statement than something that is actually enforced. As a convinced atheist, I also find it pretty weird but see absolutely no reason at all to avoid sqlite because of that. What matters is: Code quality/correctness (which is absolutely superb when it comes to sqlite) and license, of course. Why would I care about the authors beliefs? They don't even directly benefit from me using their product.

[-] TerrorBite@meow.social 1 points 1 year ago

@words_number @Sibbo that was one hell of an opening sentence to misread.

[-] gnus_migrate@programming.dev 0 points 1 year ago

I don't know, SQLite it's something that makes sense in theory, but I think its easier for ops people to just use a proper database. If you need to move the database to a separate machine, limit permissions, etc. its just easier to do.

SQLite is great for local apps that need a structured way to store their data, but I'm not really comfortable using it for more than that.

[-] abhibeckert@lemmy.world 0 points 1 year ago* (last edited 1 year ago)

Personally I never do permissions at the database layer anyway - it's always done at the application layer.

I also never move the database to a separate server - that adds too much latency. If your database is local, and "hot" tables are cached in RAM, you can do several hundred thousand queries in a split second and having performance like that can drastically reduce complexity in your business logic (and therefore, drastically reduce bugs).

[-] gnus_migrate@programming.dev 0 points 1 year ago

Regardless, I don't see it as something that is the silver bullet that people make it out to be. Being able to introspect the production database, query it, and generally have a set of tools to properly manage your data as opposed to having everything in a file fully managed by your application is something useful for me that you lose with SQLite.

[-] abhibeckert@lemmy.world 1 points 1 year ago* (last edited 1 year ago)

I'm not sure I understand your point? You can connect to and run queries/etc on the production database in SQLite.

I'm not really advocating for using SQLite by the way - I've only ever used it on smartphone apps myself where a full database wouldn't even have enough RAM to run at all. I'm just pointing out that permissions isn't a feature I've ever found useful.

For example, say I have an invoice table that is written to whenever a customer buys a product. Customers need to have write access to the table in the database. But I don't want them to be able to write anything they want - there needs to be severe restrictions on what can be written, and those have to be done outside of the database.

Since you have to do some of your permissions outside the database, it's more reliable to just do all of them there. Splitting things up with half your security in one place and half in another is asking for bugs.

The main reason I would avoid SQLite is the backup system, which essentially takes your whole database offline (for write access anyway) while the backup is running. That's just not good enough once the database reaches a size where backups take more than a moment. But if you're not storing much data, or not doing many writes, that's a non-issue.

SQLite definitely has advantages. It's often extremely fast for example. The lack of complex features removes performance bottlenecks all of the place and you can do millions of basic select queries per second in SQLite. Obviously not every query is that fast, but a lot of them are especially if you design your indexes/etc properly.

Definitely not a silver bullet, but I do think anyone who writes code that reads or writes data should be at least aware of the basic capabilities of SQLite. It's free. It's reliable. It runs literally on any platform (you can even run it client side in a webpage these days). So the only reason to avoid SQLite is if it's the wrong tool for the job. And you can't make that judgement call unless you have experience with it.

SQLite should be in every developer's toolchain, even if you don't have a use for it right now.

[-] Obsession@sh.itjust.works -1 points 1 year ago

In a world of containers and stateless applications, fuck SQLite.

[-] farcaller@fstab.sh 1 points 1 year ago

You can always use sqlite cloud

/s?

[-] abhibeckert@lemmy.world 1 points 1 year ago

... you know you can put SQLite in a container right? It doesn't even need to be persisted to disk - it can just live in RAM.

[-] Obsession@sh.itjust.works -1 points 1 year ago

If you don't care about persistence, why are you even using a DB in the first place?

this post was submitted on 16 Jul 2023
2 points (100.0% liked)

Programming

17225 readers
135 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS