r/sqlite • • Sep 29 '26

Help with creating data charts?

4 Upvotes

Hi! So I am currently creating an inventory system for my workplace using sqlite. My current plan is to have a singular table that indicates the sku, the item title, the quantity, and the dates purchased and sold. However, I want to be able to record multiple dates purchased and sold to then create some graphs based on those dates. Is there an efficient way for me to have those dates stored in the table without creating way too many columns?


r/sqlite • • Sep 29 '26

Strangest SQLite structures you’ve encountered?

0 Upvotes

What are the strangest SQLite structures you’ve encountered in production? Preferably something with a “real” user base (however you choose to interpret that).


r/sqlite • • Sep 29 '26

Built a statistics extension for SQLite — not sure if it's useful, would love your thoughts

8 Upvotes

Hi everyone,

I've been working on a small side project: a loadable extension that adds statistical functions to SQLite.

https://github.com/mitsuruk/sqlite3-stats

It started because I wanted to do some basic analysis without leaving SQL. It grew into about 250 functions (descriptive stats, hypothesis tests, distributions, window functions).

Honestly, I'm not sure whether this is something people actually need, or whether I just built it for myself 😅

If you have a moment, I'd really appreciate your input:

  • Would this be useful in your work?
  • Are there features you'd want, or things that feel unnecessary?
  • Is there something similar that already does this better?

I'm still learning, so any feedback, even critical, is very welcome.

Thanks for reading!


r/sqlite • • Sep 28 '26

I’m building a local AI assistant inside MySQL Workbench. You describe what you need in plain English, and it writes SQL directly into the editor. You review and execute it yourself—no copy-pasting. Would this be useful for SQL learners or data analysts? What concerns would you have?

2 Upvotes

r/sqlite • • Sep 26 '26

offline-first + litefs for production

2 Upvotes

i am trying to build a tool similar to notion. Offline-first is the biggest requirement. Each organization will get their own sqlite on the VPS server. 95% of reads and writes happen to local sqlite. I am thinking of building a sync engine that works based on the event table. As in every create, update or delete operation will be treated as an event. As an event is recorded into the table, it will trigger a /push api that sends this data to the server. The api will take this data and dump it into the events table on the server side sqlite file and then it will replay the event on the server. Then based on who has access to what, it will send a websocket notification to the clients that are online that new data is available in the events table. Then the clients will receive the notification and make a /pull call with the cursor which will fetch the events data from the server side sqlite and it gets recorded into the client side sqlite and then again events gets replayed at the client side which will affected the actual tables.

at the infra level, i am considering litefs to create a cluster of 3 VPS where one will be the primary node and two will be read replicas. Also planning to stream the data from primary node to s3 for backup in realtime.

Is this viable setup? This way, I am planning to eliminate the single writer limitation since 95% of writes happen locally. Litefs to make the setup distributed and HA.

I am expecting each organization account to have upto 500 users.

Please share your thoughts.


r/sqlite • • Sep 25 '26

Minimalistic tool to generate database visualisation

11 Upvotes

I'm looking for a really simple tool that can generate a UML diagram from my SQLite database, but I want to be able to change the layout if I don't like how it has been generated.

I tried some code extensions and small tools (ERD Renderer, SQLite DB Explorer, plant_erd) but some are not working on my VSCode version; when they are working, I can't personalise the result.

If someone knows a tool that can generate a plant UML diagram (or something similar) from SQLite database and where we can specify the layout. I would be happy to know it


r/sqlite • • Sep 24 '26

SQLite migrations in browser

5 Upvotes

I've been working on a open source cli tool called Ptah since June 2025. It is a feature rich MIT-licensed solution for managing DB changes. Among other DB engines it natively supports sqlite.

For easier onboarding I created this playground: https://play.ptah.run . You can go with a scenario or free way. You can upload your own database file or use the given one. Note, nothing leaves your browser - everything is processed in-memory. You can then export the results of your session.

Desktop view

Some technical details: ptah is written in Go and compiled in web assembly. SQLite is also compiled in web assembly - this is the way both run and interact in your browser. You can check the repo for the sandbox here: https://github.com/stokaro/ptah-sandbox .

I tried to make the playground usable both on desktops and mobile devices.

Mobile view

Would love to hear your feedback, and happy to answer any questions.


r/sqlite • • Sep 21 '26

I didn't want to pay a subscription to browse my own database, so I built DBison

Thumbnail reddit.com
0 Upvotes

r/sqlite • • Sep 17 '26

An append-only, in-memory text database built in Nim with persistence and multiple interaction interfaces

Thumbnail github.com
4 Upvotes

r/sqlite • • Sep 16 '26

Built a SQLite like database along with Visualizer for learners.

Post image
13 Upvotes

https://mokudb-visualization.com

I'd love feedback, especially on the WAL visualization — I feel it's currently too simplistic and doesn't capture the mechanism as well as the B+Tree view does.

Repo: https://github.com/Moku3956/Project-D


r/sqlite • • Sep 16 '26

80k downloads first week? I did it! Now let’s talk about integrating NEDB in your project !

Thumbnail
1 Upvotes

r/sqlite • • Sep 15 '26

How can I improve sql-easy.com?

Thumbnail
0 Upvotes

r/sqlite • • Sep 14 '26

Pop-Database vs SQLite

Enable HLS to view with audio, or disable this notification

0 Upvotes

Pop-Database vs SQLite, 500K entities, 12 AND conditions per query, both single-threaded (CPU-affinity verified, so no thread-count trick).
Pop-Database finished in 6.26s.
SQLite finished in 88.81s.
Pop-Database is 14.2× faster — and both found the exact same 9,559 matches per query.
This ratio moves a bit run to run depending on what else the machine is doing at the time. I've seen this same test land anywhere from ~12× to ~14× depending on system load. Still solidly in the same range either way.
Trade-off is shown in the same video: SQLite inserts faster (2.64s vs 6.55s for 500K rows). Pop-Database is built for read-heavy workloads, not write-heavy ones - that's the deal!!!


r/sqlite • • Sep 12 '26

Question About Lifespan Of Cursors.

2 Upvotes

I am building a batch Python process that loads data from CSV files into a sqlite DB. As a result, I am running a lot of SQL statements. Additionally, I have created a custom DB manager that executes all SQL statements. Currently, the DB manager creates and closes a cursor for each SQL statement execution.

Is creating/closing a cursor for each SQL execution a best practice? Or, should I create a persistent cursor once for the entire process, or once per table, etc.


r/sqlite • • Sep 11 '26

gopherql - A dependency free SQL IDE for small database and learning purpose on your terminal. (Bubble Tea, CGO free SQLite)

Post image
4 Upvotes

r/sqlite • • Sep 10 '26

Built a CLI that measures whether your implied foreign keys actually hold, then writes the result as context for coding agents

8 Upvotes

https://www.npmjs.com/package/dbtruth?activeTab=readme

Same thing kept happening to me with AI coding agents and Postgres. The agent reads the schema, sees orders.customer_id next to customers.id, assumes it's a clean relationship, and writes an INNER JOIN. If 12% of orders have a dangling or null customer_id, the query silently returns numbers that are wrong. Nothing throws. The schema looked fine.

So I wrote dbtruth. It connects read-only and, instead of dumping the schema into a context file, it does four things:

  1. Introspects schema and pulls samples
  2. A model proposes what the tables mean and which relationships probably exist
  3. Every one of those claims gets measured against the actual data
  4. Only what survives gets written to ./context/*.md, which the agent reads before writing SQL

Step 3 is the whole point. For a proposed join it reports the real match rate — orders.customer_id → customers.id holds for 88% of rows, 60 of 500 orders have no matching customer — and the context file says use LEFT JOIN, with the number attached. Under 50% gets dropped. In between gets marked broken and goes to the top of the report, because a relationship that half works is worse than one that doesn't exist.

Practical:

  • npx dbtruth, Node 20+, Postgres only
  • Read-only by construction, not by discipline: one module is allowed to import pg, and a test asserts nothing else does. It never writes to your database.
  • It does call a model, so schema and low-cardinality sample values leave your machine. High-cardinality columns — emails, names, free text — are never sent. Visibility is decided by cardinality rather than by regex-guessing at PII. Don't point it at production data you can't send to a third party.
  • MIT, source at github.com/FilipKalcic1/dbtruth#readme

Disclosure: it's mine, it's five days old, and about ten people have run it. None of the pieces are new — FK inference and data profiling both go back years, and there are other tools that build local context artifacts for agents. The part I care about is the rule that nothing unmeasured gets written down.

What I'd actually like to know: run it on a schema you know well, and tell me whether it found anything you didn't already know. That's the only signal that tells me whether this is worth continuing. Bug reports welcome too.


r/sqlite • • Sep 10 '26

A path column that may or may not point at a local file, and nothing in the schema says which. Is there a pattern for this?

11 Upvotes

I have been reading Apple's Messages database on my own Mac, 367,942 rows, and hit something that feels like a general schema problem rather than an Apple one.

The attachment table has 7,332 rows carrying a filename. sum(total_bytes) across them is 9,448 MB. The directory those filenames point into holds 13 MB. I stat'd a sample of 4,000 of the paths and 13 of them existed. Images were worse, 9 out of 2,000.

That is iCloud having offloaded them, which is expected and fine. What I cannot find is anywhere in the schema that admits it. transfer_state is 0 on the rows I looked at, present and absent alike. total_bytes is the size of a file that is not here. Every column reads like a local file, and the only way to know is to stat the path, which is outside the database entirely.

It matters because it is the difference between an export that is complete and one that only says it is. Join message to attachment, write out what you get, and you have a manifest of 9.2 GB of media you do not have, with nothing in the query result being wrong.

The same shape turns up on the other side of the file. text on the message table is populated on 3.9% of my rows. The rest of the content is in a BLOB called attributedBody, which is a typedstream, the old NSArchiver format, and no SQL you write is going to reach into it.

So I have ended up doing it the blunt way. Stat every path, decode every blob, keep the counts, print them next to each other so the numbers can be checked against each other. It works, but it means a full pass before I can answer anything about my own data, and the counts live in my code rather than in the file.

The question. For a column that names a resource which may or may not be local, in a database you do not control and cannot add a trigger to, is there a better pattern than a full stat pass and a cached count? I keep reaching for a generated column and there is obviously nothing in the row to generate it from.

Disclosure since it is where this came from: I write a Mac app called Loose Ends that exports the archive, and the counting turned out to be most of what I actually shipped.


r/sqlite • • Sep 10 '26

Secure Remote Database Proxy: Expose Local PostgreSQL & RediS

Thumbnail instatunnel.my
6 Upvotes

r/sqlite • • Sep 10 '26

I Turned SQL Practice Into a Mystery Game

Thumbnail v.redd.it
0 Upvotes

r/sqlite • • Sep 09 '26

What does a useful restore drill for a live SQLite database actually test?

7 Upvotes

Creating a consistent backup with the online backup API, VACUUM INTO, or another WAL-aware method is only the first half of the job. A restored file can pass integrity_check and still be unusable to the application because expected rows are missing, foreign keys are invalid, migrations cannot run, or linked files no longer match the database state.

What belongs in a realistic restore drill? I am considering restoring into an isolated directory, opening the copy through the actual application version, running integrity_check and foreign_key_check, checking a few domain invariants and recent records, exercising a read and a harmless write transaction, then recording the backup checkpoint and recovery time.

How do you choose assertions that detect a logically incomplete backup without turning every drill into a full test suite?


r/sqlite • • Sep 08 '26

ICUex: Unicode collations, case folding, and normalization

6 Upvotes

I have published ICUex, a small, public-domain SQLite C extension providing two automatically registered ICU collations, locale-independent full Unicode case folding, and normalization/search-key functions. It can be loaded dynamically or linked statically and is designed to complement the official SQLite ICU extension.

⚡Automatically Registered Collations

  • UTF_CI — ICU root collation, case-insensitive and accent-sensitive; е/ё and и/й remain distinct.
  • UTF_CI_AI — compares NFKD_CF_STRIP keys; case- and compatibility-insensitive, with nonzero-CCC combining marks removed. Thus, е/ё and и/й compare equal.

Neither requires icu_load_collation(), locale selection, or setup SQL.

🧩Case Folding and Normalization

  • str_casefold(text) — locale-independent full Unicode case folding.
  • str_normalize(text, mode) — Unicode normalization or search-key generation.
    • NFC, NFD — canonical normalization.
    • NFKC, NFKD — compatibility normalization.
    • NFKC_CF — NFKC case folding and removal of default-ignorable code points.
    • NFKD_CF_STRIP — NFKD, removal of nonzero-CCC code points, then NFKC case folding.

Unlike the ICU extension’s lower() overload, full case folding is intended for locale-independent caseless matching, e.g., Straße becomes strasse, while Greek sigma variants and compatibility ligatures are folded consistently.


r/sqlite • • Sep 08 '26

How should a Local-First AI Memory Engine scale between SQLite and Volatile RAM?

Thumbnail
0 Upvotes

Help me


r/sqlite • • Sep 06 '26

I built a browser-local SQLite viewer — looking for edge cases

Post image
11 Upvotes

I’ve just shipped a free SQLite viewer for the case where someone sends you a .db or .sqlite file and you want to inspect it immediately, without installing a desktop tool.

I’d genuinely value hostile testing from this community: unusual schemas, large files, views, triggers, WAL-related workflows, and anything that makes browser viewers misleading.

SQLite Viewer:
https://streams.dbconvert.com/sqlite-viewer

Update (Sep 18): thanks for the testing and the feedback. What changed since:

  • ER diagram. A Diagram tab draws every table and view with the foreign keys the file declares.
  • Several files in one query. Open up to ten .db files and each is attached under its own name, so one query can join or diff them. It's SQLite's own ATTACH, and nothing is written back.
  • UTF-16 databases open as well as UTF-8.
  • In the editor. The same viewer runs as an extension for VS Code, and for Cursor, Windsurf and VSCodium via Open VSX: click a .db in the file tree and it opens as a tab. It's also on the Chrome Web Store.
  • AI agents. In the editor, an agent such as Claude Code, Codex or Copilot can list the tables of the open file and run read-only queries on it. The file still never leaves your machine.

Still looking for files that break it: odd schemas, huge files


r/sqlite • • Sep 06 '26

Review Gearberg Codebase

0 Upvotes

Hi, I have a project called [Gearberg](https://github.com/bit8bytes/gearberg) (OSS) and would like to get some feedback of the current code. Main focus is single binary (FE & BE) and SQLite/PostgreSQL database support.

Thanks!


r/sqlite • • Sep 05 '26

sabiql now supports SQLite

Post image
1 Upvotes

Hey! I’ve been building a database TUI called sabiql and recently added SQLite support.

It lets you browse tables, run queries, edit data, check query plans, etc. with Vim-style keybindings.

If anyone here gives it a try, I’d love to hear what you think or what’s missing.

https://github.com/riii111/sabiql