Hacker News new | past | comments | ask | show | jobs | submit login
SQLite-Web: Web-based SQLite database browser written in Python (github.com/coleifer)
181 points by thunderbong on Feb 8, 2024 | hide | past | favorite | 45 comments



Here's one that works entirely clientside via Webassembly - https://sqliteviewer.app/

Upload your bloated firefox `places.sqlite` and select `moz_places` and it loads it without a hitch... if you trust the website not to steal your browsing history.

Unfortunately sqliteviewer.app is not open source. This one (https://inloop.github.io/sqlite-viewer/) is, though. But it uses a JS reimplementation of sqlite rather than true sqlite in WASM.


What about the official project? https://sqlite.org/wasm/doc/trunk/index.md


Yep. Getting sqlite working in webassembly is almost a production-ready feat these days. I was mainly looking for things that bolt management GUIs on top of what is already possible.


Check out the "In the Wild" section on that page, here's the first link https://github.com/nalgeon/sqlime


https://beta.sqliteviewer.app uses this (with some modifications) under the hood.

Since it's OPFS-based instead of in-memory, it can open much larger sqlite files, up to the browser-determined size limit.


I've had success using sql.js (https://sql.js.org) for small, hobby projects. It's just SQLite compiled to WASM. They have a link to an online demo at the top of the homepage, which may be the exact tool that you're hoping for.


Since it's webassembly, I wonder if it can be made to work completely on the client with something like Orca (https://orca-app.dev/) so you don't even need to trust the website.


It already works completely clientside. The page makes no requests to the server after putting your DB into it.


I meant without the browser as its own client. How can you be sure the page won't change and upload your db the next time you use it?


You can't, but as the author I can assure you that I'm very trustworthy lol

I've been thinking about a standalone version for a while, but haven't gotten around to it. You could use the vscode/codium extension and disable auto updating for a similar effect.


Another great browser for SQLite - DB Browser for SQLite (DB4S) project (https://github.com/sqlitebrowser/sqlitebrowser). An amazing piece of software for interacting with SQLite databases. Supports inspecting and modifying data, full query support, integrated plotting functions.


I usually just spin up datasette (hi, simonw) for this, although this looks prettier in a “they just used bootstrap“ kinda way (not that I'm denigrating that… it made all our internal tools at work look really nice for years!).

datasette's origin story orients it towards readonly access, and it is strictly and overwhelmingly more powerful in that regard, due to the 139 and growing plugins. The 46 (according to the website) associated tools that datasette has should work equally well with any sqlite-related tooling.

Also, datasette's completely automatic faceting (if your data is sane-ish) is really nice.

Hmmm. They're both Python… maybe they should unite, Voltron style! :-)


Non-IT guy here, can someone explain to me how good/bad of an idea using this simple setup of SQLite + this interface as the core DBMS in a commercial setting would be?

The interfaces I have used in my experience were built in-house over Apache Spark and Microsoft SQL, and always felt overengineered and more complicated than it needed to be. For the record I have learnt data retrieval and analysis only on the job and not from any formal training, apologies if I am missing something fundamental.


SQLite can start to show weaknesses when you need a bunch of people or processes writing to it at the same time. For small applications or applications where you can tightly control what is talking to it at any given time, SQLite is great. Enterprise products tend to target larger organizations where a more overengineered solution is likely commonly available anyways.

Generally though, I want developers to justify why SQLite isn't good enough for their app before they build on something else. In a lot of cases SQLite absolutely is good enough, and it removes an insane amount of complexity, especially from things like database backups.


I remember really pushing for SQLite for a specific application that used MS SQL... The main data in practice has requirements to be archived by event. And didn't need more than a few dozen users with low transactions in practice. Easy backup, archive etc.

In the end, there was a complex solution with a all the business logic in stored procedures and functions. With a lot of variability and difficulty supporting the application.

This was for a petition verification system. So each petition could have easily fit into a SQLite database. Been portable and easy to archive, backup, transport etc.

But no,. We had to put all the logic in the database... Because integritai...


i tend to lean the other way. postgres is just so easy. with managed db services, you dont have to think about backups, version upgrades, all the rest. you never have to worry about running into a rough edge or missing feature. the maturity and huge community make it hard to go wrong


Agreed... As soon as you need shared access to multiple systems, PG it is, usually in Docker though if it doesn't need a dedicated instance.

Though I have used Firebird when I needed to scale it support local and remote data before. I don't think Figured gets nearly enough attention.


They have a page for this: https://www.sqlite.org/whentouse.html


From the referenced page:

> SQLite does not compete with client/server databases. SQLite competes with fopen().


That page also doesn't mention that SQLite can act as a gateway drug.

Store stuff in SQLite now, and use a RDBMS later when it makes sense.


Similar to MS Access.


Well, there's Turso and Cloudflare D2 as examples of how you can scale SQLite in practice.

In terms of a simple API over SQLite, it will depend on the number of users, the overhead and the cache ability of tall data in practice.

If you have a heavy transactional load, it may not go so well. Similarly, any service may be better implemented in a single connection with seriously requests, which will limit this but reduce complexity.

Realistically, PostgreSQL in Docker is pretty much my baseline for a shared database server. If other systems really need to access it, it's going to be the easier path.

Even Firebird would likely be a better option for many lower end use cases where a shared service is needed.


From my experience on a fun project, it's fine for running your website, but if you need to edit data as values update, pulling down the db, making changes then uploading the DB will obviously not do. You'll need some sort of web interface like phpliteadmin; and if you're not running php well now you are. Unless you want to use a docker image, and now you're using docker.

I wish there was a real simple way to connect to a remote db like you do with postgres.


if you can SSH into the remote server where the .sqlite database is saved, then you can do anything can't you? Including editing the data without down/uploading the whole DB. Perhaps also make use of sshfs, if you want to use a GUI installed on your workstation.


We think SQLite in a commercial setting is perfect and that’s why we built https://airsequel.com. A full fledged SQLite hosting platform with an automatic GraphQL API, cloud functions, dashboards, … We totally agree that most enterprise software is too complicated for “normal” businesses. Those tools were often developed by the biggest fish for their outsized problems.


I think you think wrong.


if it's built in house it's probably got some business logic / rules built into it.

This tool wont necessarily know about any specifics about how the database relates to your business.


I understand why people want to write in python, but I don't understand why anyone wants to use software written in python if it might be sensitive to latency, performance or interactivity.


This uses peewee, which is probably the nicest ORM I’ve ever used anywhere.


This is something I was actually looking for a while ago and settled for a linuxserver's docker image running vnc and sqlitebrowser to inspect some databases on my homelab, which felt like an unsatisfying solution - this looks a like a much nicer, better and more lightweight solution.


Suggestion: toggle to show/hide the sidebar (the table list) to give more space for table contents.



That looks slick! May I express my feedback: the "content" tab should show the data as grid and maybe have an inline editor. Grid is the ultimate display of table data, at least for me. Thanks for sharing!


If you’re interested in hosting your SQLite databases online for sharing, collaboration, and as the backbone of your apps, please check out https://airsequel.com. We’ve been working on it for the last 2 years and our next release is going to be the 1.0! Let me know what you think


Sad story, database could be native in browsers. Only because every browser adapt the same technology sqlite and w3c said no....


Strange because if every browser adopts sqlite why not let people use it ? W3c will not prevent people using some tech ? Ofc it won't be standard, until it is? Soon, sqlite implementations may even fork and then we would need standardising.


I think that the ultimate result (sqlite-wasm) is better than what Web SQL database could provide. Today you can bundle your own version with your own set of native extensions. In case of standard Web SQL you would be forced to check the version and figure out, is it finally possible to use RETURNING in queries.


My favorite web-based SQL editor and browser: https://www.adminer.org

Single PHP file. Super simple setup and configuration.


I guess if you need a web-based solution this looks nice. Otherwise SQLiteStudio is definitely better.


I think something like this for Duckb would also be amazing!


Any advantages over phpliteadmin, for example?


hello, at work, I am not admin. I have developed a small flask site using sqlite. Always using commandline was painful. I have considered phpliteadmin, but this requires many tasks for installation. My boss would not understand that I spend half a day on this. I have discovered SQLite-web today. It took me less than a minute to use it. This is exactly what I was looking for.


I'd suggest spending a little time with Docker and compose.. even in small, single server applications it helps a lot to smooth out application deployments.

It will reduce friction in practice.


I don't understand, what's the point of writing this in python?


As opposed to? FWIW the author has many Python tools, including a popular ORM (https://github.com/coleifer/peewee)




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: