SQLite has very few functions compared to other DBMS. SQLite authors see this as a feature rather than a bug, because SQLite has extension mechanism in place.
There are a lot of SQLite extensions out there, but they are incomplete, inconsistent and scattered across the internet.
sqlean
brings them all together, neatly packaged into domain modules, tested, and built for Linux, Windows and macOS.
Here is what we've got right now:
- crypto: secure hashes
- fuzzy: fuzzy string matching and phonetics
- ipaddr: IP address manipulation
- json1: JSON functions
- math: math functions
- re: regular expressions
- spellfix: similarity search for large tables
- stats: math statistics
- text: string functions
- unicode: Unicode support
- uuid: Universally Unique IDentifiers
- vsv: CSV files as virtual tables
There are precompiled binaries for every OS:
*.dll
- for Windows*.so
- for Linux*.dylib
- for macOS
Binaries are 64-bit and require a 64-bit SQLite version. If you are using SQLite shell on Windows (sqlite.exe
), its 64-bit version is available at https://github.com/nalgeon/sqlite.
CLI usage:
sqlite> .load ./stats
sqlite> select median(value) from generate_series(1, 100);
IDE usage:
select load_extension('/path/to/extension/stats');
select median(value) from generate_series(1, 100);
In-app usage:
import sqlite3
connection = sqlite3.connect(":memory:")
connection.enable_load_extension(True)
connection.load_extension("./stats.so")
connection.execute("select median(value) from generate_series(1, 100)")
connection.close()
You can specify any other supported extension instead of stats
.
Follow @ohmypy on Twitter to keep up with new features 🚀