198 private links
With this it is possible to try SQLite in the browser. The whole thing runs using WASM (compiled using Emscripten) and was announced by Richard Hipp as part of the SQLite 3.39.0 beta in the SQLite forum.
What is also interesting is that to load the page, less than 1 MB of data needs to be loaded. If compression were enabled, this could probably be reduced further.
sqlite3 fiddle could make it easier to quickly try something with SQLite. Instead of downloading sqlite3 first and then trying it out locally, you just open the page and can quickly use the latest sqlite3 version.
How to have temporary data:
1 - Common Table Expression (or basically a named subquery)
2 - View: works like a CTE, but you can reference it by name and not repeat the subquery every time. Views are computed on the fly, similar to CTEs.
3 - A temporary table is like a real table: it stores data on disk, and you can build indexes. But it exists only while the database connection is open.
PostgreSQL and others have materialized views, which store data on disk
When to use temporary tables ?
Temporary tables are great for experimenting when you’re just getting to know the data.
x15 write speed :D
How ?
With Queued Writes rqlite itself can now queue a set of received write-requests, internally batch them, and then write that batch to the Raft log as a single log entry. This is key — by putting more data in a single Raft log, all of those previously distinct requests now result in a single Raft transaction, reducing the number of network round trips to a minimum.
Implementation of the queue : https://github.com/rqlite/rqlite/tree/v7.5.0/queue
Creating virtual columns in SQLite to greatly improve SQL queries. So
however I don't think that storing JSON as-is is a good idea...
But yes, it is almost a NoSQL database ツ
It is possible to export SQLite data to markdown 😯
.mode markdown
That's great !
Et une application tournant sous électron avec une BDD SQLite en typescript bien propre, c'est partiii.
Ou un programme Deno / NodeJS
A command-line client for SQLite databases that has auto-completion and syntax highlighting.
:o
SQLite est un système de BDD super, mais simple. Cependant, des extensions ont été dévelopée :+1:
Richard Hipp is the creator of Fossil too.
(Background: SQLite is the most used database in the world. Everyone uses it. It's in Windows, in Photoshop, in Firefox, in your smartphone, in your connected TV, in your fitness bracelet, it's in almost every connected object. It is used to store and organize information, and it has the advantage of being remarkably reliable, light and running on virtually all existing systems (processors, languages, operating systems ...). It is probably one of the most used software in the world... but the general public does not know it).
Optimisations:
- Make use of SQLite PRAGMA statements when possible
- Use prepared statements
- Do a batched insertions
- PyPy is actually 4x faster than CPython
- Threads / async may not be faster always
In CPython: 510s
In PyPy: 150s
In Rust: 33s
It is possible.
Some tips for it
Les bonnes raisons d'utiliser SQLite.
(via sebsauvage)
Queries can be run on multiple databases 💚 (see https://www.sqlite.org/lang_attach.html for more)
The command ATTACH 'other.db' AS other;
In python, there is the db.attach
for it !
A reason to use sqlite for small projects.
SQLite is not client/server, however. The SQLite database runs in the same process address space as the application. Queries do not involve message round-trips, only a function call. The latency of a single SQL query is far less in SQLite. Hence, using a large number of queries with SQLite is not the problem.