diff --git a/README.md b/README.md index 0ec467b7..0fa463bc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# All the Missing SQLite Functions +# All the missing SQLite functions SQLite has few functions compared to other database management systems. SQLite authors see this as a feature rather than a problem, because SQLite has an extension mechanism in place. @@ -66,7 +66,7 @@ sqlite> .load ./sqlean sqlite> select median(value) from generate_series(1, 99); ``` -See [How to Install an Extension](docs/install.md) for usage with IDE, Python, JavaScript, etc. +See [How to install an extension](docs/install.md) for usage with IDE, Python, JavaScript, etc. ## Building from source diff --git a/docs/crypto.md b/docs/crypto.md index 01a744d2..e27c9071 100644 --- a/docs/crypto.md +++ b/docs/crypto.md @@ -1,6 +1,10 @@ -# crypto: Hashing, Encoding and Decoding in SQLite +# crypto: Hashing, encoding and decoding in SQLite -Hashing, encoding and decoding functions. +The `sqlean-crypto` extension provides hashing, encoding and decoding functions. + +[Hashing](#hashing-and-message-digest-functions) • +[Encoding/decoding](#encoding-and-decoding-functions) • +[Installation and usage](#installation-and-usage) ## Hashing and message digest functions @@ -165,7 +169,7 @@ select crypto_decode('%2Fhello%3Ft%3D%28%E0%B2%A0_%E0%B2%A0%29', 'url'); -- /hello?t=(ಠ_ಠ) ``` -## Installation and Usage +## Installation and usage SQLite command-line interface: @@ -174,8 +178,10 @@ sqlite> .load ./crypto sqlite> select hex(crypto_md5('abc')); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/define.md b/docs/define.md index a17b6dc1..4f55bede 100644 --- a/docs/define.md +++ b/docs/define.md @@ -1,10 +1,16 @@ -# define: User-Defined Functions in SQLite +# define: User-defined functions in SQLite -Write arbitrary functions in SQL (as opposed to [application-defined functions](https://sqlite.org/appfunc.html), which require programming in C, Python, or another language). Or even execute arbitrary SQL from a string. +The `sqlean-define` extension allows writing arbitrary functions in SQL (as opposed to [application-defined functions](https://sqlite.org/appfunc.html), which require programming in C, Python, or another language). Or even execute arbitrary SQL from a string. -Adapted from [statement_vtab.c](https://github.com/0x09/sqlite-statement-vtab/blob/master/statement_vtab.c) by 0x09 and [eval.c](https://www.sqlite.org/src/file/ext/misc/eval.c) by D. Richard Hipp. +[Scalar Functions](#scalar-functions) • +[Table-valued functions](#table-valued-functions) • +[Arbitrary SQL statements](#arbitrary-sql-statements) • +[Performance](#performance) • +[Reference](#reference) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) -## Scalar Functions +## Scalar functions `select define(NAME, BODY)` @@ -85,7 +91,7 @@ sqlite> select sumn(5); Parse error: no such function: sumn ``` -## Table-Valued Functions +## Table-valued functions `create virtual table NAME using define((BODY))` @@ -155,7 +161,7 @@ sqlite> select * from strcut('one;two', ';'); Parse error: no such table: strcut ``` -## Arbitrary SQL Statements +## Arbitrary SQL statements `eval(SQL[, SEPARATOR])` @@ -259,7 +265,11 @@ Executes arbitrary SQL and returns the result as string (if any). Deletes a previously defined function (scalar or table-valued). -## Installation and Usage +## Acknowledgements + +Adapted from [statement_vtab.c](https://github.com/0x09/sqlite-statement-vtab/blob/master/statement_vtab.c) by 0x09 and [eval.c](https://www.sqlite.org/src/file/ext/misc/eval.c) by D. Richard Hipp. + +## Installation and usage SQLite command-line interface: @@ -269,8 +279,10 @@ sqlite> select define('sumn', ':n * (:n + 1) / 2'); sqlite> select sumn(5); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/fileio.md b/docs/fileio.md index 4fe3c0b2..8ce6bcdf 100644 --- a/docs/fileio.md +++ b/docs/fileio.md @@ -1,6 +1,12 @@ -# fileio: Read and Write Files in SQLite +# fileio: Read and write files in SQLite -Access the file system directly from SQL. Partly based on the [fileio.c](https://sqlite.org/src/file/ext/misc/fileio.c) by D. Richard Hipp. +The `sqlean-fileio` extension provides means to access the file system directly from SQL. + +[Reference](#reference) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) + +## Reference Main features: @@ -248,7 +254,11 @@ lsdir = fileio_ls lsmode = fileio_mode ``` -## Installation and Usage +## Acknowledgements + +Partly based on the [fileio.c](https://sqlite.org/src/file/ext/misc/fileio.c) by D. Richard Hipp. + +## Installation and usage SQLite command-line interface: @@ -257,8 +267,10 @@ sqlite> .load ./fileio sqlite> select fileio_read('whatever.txt'); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/fuzzy.md b/docs/fuzzy.md index 70d91d7f..8eacf78c 100644 --- a/docs/fuzzy.md +++ b/docs/fuzzy.md @@ -1,16 +1,20 @@ -# fuzzy: Fuzzy String Matching and Phonetics in SQLite +# fuzzy: Fuzzy string matching and phonetics in SQLite -Fuzzy-matching helpers: +The `sqlean-fuzzy` extension provides fuzzy-matching helpers: - Measure distance between two strings. - Compute phonetic string code. - Transliterate a string. -Adapted from [libstrcmp](https://github.com/Rostepher/libstrcmp) by Ross Bayer and [spellfix.c](https://www.sqlite.org/src/file/ext/misc/spellfix.c) by D. Richard Hipp. +If you want a ready-to-use mechanism to search a large vocabulary for close matches, see the [spellfix](https://github.com/nalgeon/sqlean/issues/27#issuecomment-1002297477) extension instead. -If you want a ready-to-use mechanism to search a large vocabulary for close matches, see the [spellfix](https://github.com/nalgeon/sqlean/issues/27#issuecomment-1002297477) extension. +[String distances](#string-distances) • +[Phonetic codes](#phonetic-codes) • +[Transliteration](#transliteration) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) -## String Distances +## String distances These functions measure the distance between two strings. @@ -97,7 +101,7 @@ select fuzzy_osadist('awesome', 'aewsme'); -- 3 ``` -## Phonetic Codes +## Phonetic codes These functions compute phonetic string codes. @@ -188,7 +192,11 @@ select fuzzy_translit('oh my 😅'); -- oh my ? ``` -## Installation and Usage +## Acknowledgements + +Adapted from [libstrcmp](https://github.com/Rostepher/libstrcmp) by Ross Bayer and [spellfix.c](https://www.sqlite.org/src/file/ext/misc/spellfix.c) by D. Richard Hipp. + +## Installation and usage SQLite command-line interface: @@ -197,8 +205,10 @@ sqlite> .load ./fuzzy sqlite> select fuzzy_soundex('hello'); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/install.md b/docs/install.md index 40fa8bad..694914c4 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,10 +1,19 @@ -# How to Install an Extension +# How to install an extension -The easiest way to try out `sqlean` extensions is to use the [pre-bundled shell](shell.md). But if you prefer to use the standard SQLite shell, IDEs or software APIs — read on. +The easiest way to try out Sqlean extensions is to use the [pre-bundled shell](shell.md). But if you prefer to use the standard SQLite shell, IDEs or software APIs — read on. Examples below use the `stats` extension; you can specify any other supported extension. To load all extensions at once, use the single-file `sqlean` bundle. -## Download: manually +- [Download: Manually](#download-manually) +- [Download: Package manager](#download-package-manager) +- [Install: Command-line interface](#install-command-line-interface) +- [Install: GUI database browser](#install-gui-database-browser) +- [Install: Python](#install-python) +- [Install: Node.js](#install-nodejs) +- [Install: Browser JavaScript](#install-browser-javascript) +- [Install: Go](#install-go) + +## Download: Manually There are [precompiled binaries](https://github.com/nalgeon/sqlean/releases/latest) for every OS: @@ -18,7 +27,7 @@ Binaries are 64-bit and require a 64-bit SQLite version. If you are using SQLite Other extensions are available for download from [sqlpkg.org](https://sqlpkg.org/). -## Download: package manager +## Download: Package manager Personally, I'm not a fan of managing the extensions manually. I always tend to put them in different places and can't find them later. So I created [`sqlpkg`](https://github.com/nalgeon/sqlpkg-cli) — a package manager for SQLite extensions. @@ -184,14 +193,14 @@ import ( ) func main() { - sql.Register("sqlite3_with_extensions", + sql.Register("sqlite_ext", &sqlite3.SQLiteDriver{ Extensions: []string{ `c:\Users\anton\sqlite\stats`, }, }) - db, err := sql.Open("sqlite3_with_extensions", ":memory:") + db, err := sql.Open("sqlite_ext", ":memory:") db.Query("select median(value) from generate_series(1, 99)") db.Close() } @@ -210,17 +219,17 @@ import ( ) func main() { - sql.Register("sqlite3_with_extensions", + sql.Register("sqlite_ext", &sqlite3.SQLiteDriver{ Extensions: []string{ "/Users/anton/Downloads/stats", }, }) - db, err := sql.Open("sqlite3_with_extensions", ":memory:") + db, err := sql.Open("sqlite_ext", ":memory:") db.Query("select median(value) from generate_series(1, 99)") db.Close() } ``` -Note that we use the same identifier `sqlite3_with_extensions` in the `sql.Register` and `sql.Open`. +Note that we use the same identifier `sqlite_ext` in the `sql.Register` and `sql.Open`. diff --git a/docs/ipaddr.md b/docs/ipaddr.md index 1b386148..ac116b46 100644 --- a/docs/ipaddr.md +++ b/docs/ipaddr.md @@ -1,9 +1,15 @@ -# ipaddr: IP Address Manipulation in SQLite +# ipaddr: IP address manipulation in SQLite -Functions to manipulate IPs and subnets. Created by [Vincent Bernat](https://github.com/vincentbernat). +The `sqlean-ipaddr` extension provides functions to manipulate IPs and subnets. ⚠️ This extension is not available on Windows. +[Reference](#reference) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) + +## Reference + [contains](#ipcontains) • [family](#ipfamily) • [host](#iphost) • @@ -75,7 +81,11 @@ select ipnetwork('192.168.16.12/24'); -- 192.168.16.0/24 ``` -## Installation and Usage +## Acknowledgements + +Contributed by [Vincent Bernat](https://github.com/vincentbernat). + +## Installation and usage SQLite command-line interface: @@ -84,8 +94,10 @@ sqlite> .load ./ipaddr sqlite> select ipfamily('2001:db8::1'); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/math.md b/docs/math.md index 0f02bb89..7df8f42f 100644 --- a/docs/math.md +++ b/docs/math.md @@ -1,7 +1,6 @@ # math: Mathematics in SQLite -Common math functions for SQLite versions compiled without the `SQLITE_ENABLE_MATH_FUNCTIONS` flag. -Adapted from SQLite source code ([func.c](https://sqlite.org/src/file/src/func.c)). +The `sqlean-math` extension provides common math functions for SQLite versions compiled without the `SQLITE_ENABLE_MATH_FUNCTIONS` flag. Provides following functions: @@ -17,7 +16,11 @@ Provides following functions: [Full description](https://sqlite.org/lang_mathfunc.html) -## Installation and Usage +## Acknowledgements + +Adapted from SQLite source code ([func.c](https://sqlite.org/src/file/src/func.c)). + +## Installation and usage SQLite command-line interface: @@ -26,8 +29,10 @@ sqlite> .load ./math sqlite> select math_sqrt(9); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/regexp.md b/docs/regexp.md index d9fbddfe..e91af859 100644 --- a/docs/regexp.md +++ b/docs/regexp.md @@ -1,14 +1,21 @@ -# regexp: Regular Expressions in SQLite +# regexp: Regular expressions in SQLite -Regexp search and replace functions. Based on the [PCRE2](https://github.com/pcre2project/pcre2) engine, this extension supports all major regular expression features (see the section on syntax below). +The `sqlean-regexp` extension provides regexp search and replace functions. Supports all major regular expression features (see the section on syntax below). Supports Unicode in character classes (like `\w`) and assertions (like `\b`). +[Reference](#reference) • +[Supported syntax](#supported-syntax) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) + +## Reference + [regexp](#regexp-statement) • [like](#regexp_like) • [substr](#regexp_substr) • [capture](#regexp_capture) • -[replace](#regexp_replace) • +[replace](#regexp_replace) ### REGEXP statement @@ -162,7 +169,11 @@ select regexp_substr('the YEAR is 2021', '(?i)year'); -- YEAR ``` -## Installation and Usage +## Acknowledgements + +Based on the [PCRE2](https://github.com/pcre2project/pcre2) engine. + +## Installation and usage SQLite command-line interface: @@ -171,7 +182,7 @@ sqlite> .load ./regexp sqlite> select regexp_like('abcdef', 'b.d'); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. [⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • [✨ Explore](https://github.com/nalgeon/sqlean) • diff --git a/docs/stats.md b/docs/stats.md index af0694a2..9868d2c7 100644 --- a/docs/stats.md +++ b/docs/stats.md @@ -1,8 +1,16 @@ -# stats: Mathematical Statistics in SQLite +# stats: Mathematical statistics in SQLite -Common statistical functions. Adapted from [extension-functions.c](https://sqlite.org/contrib/) by Liam Healy, [percentile.c](https://sqlite.org/src/file/ext/misc/percentile.c) and [series.c](https://sqlite.org/src/file/ext/misc/series.c) by D. Richard Hipp. +The `sqlean-stats` extension provides common statistical functions. -### Aggregate Functions +[Reference](#reference) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) + +## Reference + +There are aggregate functions such as median and percentile, and a table-valued sequence function for generating sequences. + +### Aggregate functions - `stats_median(x)` — median (50th percentile), - `stats_p25(x)` — 25th percentile, @@ -47,7 +55,11 @@ The `stats_seq()` table has a single result column named `value` holding integer `stop` defaults to 9223372036854775807. `step` defaults to 1. -## Installation and Usage +## Acknowledgements + +Adapted from [extension-functions.c](https://sqlite.org/contrib/) by Liam Healy, [percentile.c](https://sqlite.org/src/file/ext/misc/percentile.c) and [series.c](https://sqlite.org/src/file/ext/misc/series.c) by D. Richard Hipp. + +## Installation and usage SQLite command-line interface: @@ -56,8 +68,10 @@ sqlite> .load ./stats sqlite> select stats_median(value) from stats_seq(1, 99); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/text.md b/docs/text.md index f97a0aca..b189faef 100644 --- a/docs/text.md +++ b/docs/text.md @@ -1,43 +1,21 @@ -# text: String Functions in SQLite +# text: String functions in SQLite -A rich set of string functions, from `slice`, `contains` and `count` to `split_part`, `trim` and `repeat`. +The `sqlean-text` extension provides a rich set of functions for working with text. -Many of the functions are Postgres-compatible (i.e. they have the same alias and logic as in PostgreSQL). It can be useful when migrating from SQLite to PostgreSQL or vice versa. +Also provides Unicode-aware functions for changing text case (upper, lower, title), plus a custom nocase collation. -Provides Unicode-aware functions for changing text case (upper, lower, title), plus a custom nocase collation. +Many of the functions are Postgres-compatible (i.e. they have the same alias and logic as in PostgreSQL). It can be useful when migrating from SQLite to PostgreSQL or vice versa. Regular expression functions are in the separate [regexp](regexp.md) extension. -[bitsize](#text_bitsize) • -[concat](#text_concat) • -[contains](#text_contains) • -[count](#text_count) • -[has_prefix](#text_has_prefix) • -[has_suffix](#text_has_suffix) • -[index](#text_index) • -[join](#text_join) • -[last_index](#text_last_index) • -[left](#text_left) • -[length](#text_length) • -[like](#text_like) • -[lower](#text_lower) • -[lpad](#text_lpad) • -[ltrim](#text_ltrim) • -[nocase](#text_nocase) • -[repeat](#text_repeat) • -[replace](#text_replace) • -[reverse](#text_reverse) • -[right](#text_right) • -[rpad](#text_rpad) • -[rtrim](#text_rtrim) • -[size](#text_size) • -[slice](#text_slice) • -[split](#text_split) • -[substring](#text_substring) • -[title](#text_title) • -[translate](#text_translate) • -[trim](#text_trim) • -[upper](#text_upper) +[Substrings and slicing](#substrings-and-slicing) • +[Search and match](#search-and-match) • +[Split and join](#split-and-join) • +[Trim and pad](#trim-and-pad) • +[Change case](#change-case) • +[Other modifications](#other-modifications) • +[String properties](#string-properties) • +[Installation and usage](#installation-and-usage) ## Substrings and slicing @@ -570,7 +548,7 @@ select text_bitsize('one'); Postgres-compatible, aliased as `bit_length`. -## Installation and Usage +## Installation and usage SQLite command-line interface: @@ -579,8 +557,10 @@ sqlite> .load ./text sqlite> select reverse('hello'); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/third-party.md b/docs/third-party.md index 42fe583a..8a82d7cb 100644 --- a/docs/third-party.md +++ b/docs/third-party.md @@ -9,6 +9,7 @@ SQLean relies heavily on third-party SQLite extensions and open source libraries | [eval.c](https://www.sqlite.org/src/file/ext/misc/eval.c) | D. Richard Hipp | Public Domain | | extension-functions.c | Liam Healy | Public Domain | | [fileio.c](https://www.sqlite.org/src/file/ext/misc/fileio.c) | D. Richard Hipp | Public Domain | +| [go](https://github.com/golang/go) | The Go Authors | 3-Clause BSD License | | [libstrcmp](https://github.com/Rostepher/libstrcmp) | Ross Bayer | MIT License | | [percentile.c](https://sqlite.org/src/file/ext/misc/percentile.c) | D. Richard Hipp | Public Domain | | [pcre2](https://github.com/pcre2project/pcre2) | Philip Hazel | 3-Clause BSD License | @@ -20,4 +21,4 @@ SQLean relies heavily on third-party SQLite extensions and open source libraries | [statement_vtab.c](https://github.com/0x09/sqlite-statement-vtab/blob/master/statement_vtab.c) | 0x09 | Public Domain | | [stc](https://github.com/stclib/stc) | Tyge Løvset | MIT License | | [uuid.c](https://sqlite.org/src/file/ext/misc/uuid.c) | D. Richard Hipp | Public Domain | -| [vsv.c](http://www.dessus.com/files/vsv.c) | Keith Medcalf | Public Domain | +| [vsv.c](https://github.com/ncruces/kmedcalf-sqlite/blob/main/vsv.c) | Keith Medcalf | Public Domain | diff --git a/docs/unicode.md b/docs/unicode.md index aedea806..6124148d 100644 --- a/docs/unicode.md +++ b/docs/unicode.md @@ -1,8 +1,14 @@ -# unicode: Unicode Support for SQLite +# unicode: Unicode support for SQLite **⛔️ This extension is deprecated. Use [text](text.md) instead.** -Implements case-insensitive string comparison for Unicode strings. Has no external dependencies (like libicu). Adapted from [sqlite3_unicode](https://github.com/Zensey/sqlite3_unicode). +The `sqlean-unicode` extension implements case-insensitive string comparison for Unicode strings. Has no external dependencies (like libicu). + +[Reference](#reference) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) + +## Reference Provides the following unicode features: @@ -12,7 +18,7 @@ Provides the following unicode features: Tries to override the default NOCASE case-insensitive collation sequence to support UTF-8 characters (available in SQLite CLI and C API only). -### Upper and Lower +### Upper and lower ``` sqlite> select upper('привет'); @@ -55,7 +61,11 @@ sqlite> select unaccent('hôtel'); hotel ``` -## Installation and Usage +## Acknowledgements + +Adapted from [sqlite3_unicode](https://github.com/Zensey/sqlite3_unicode). + +## Installation and usage Before: @@ -76,8 +86,10 @@ sqlite> select upper('привет'); ПРИВЕТ ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/uuid.md b/docs/uuid.md index 8a922d9a..5153ee52 100644 --- a/docs/uuid.md +++ b/docs/uuid.md @@ -1,13 +1,19 @@ # uuid: Universally Unique IDentifiers (UUIDs) in SQLite -Limited support for [RFC 4122](https://www.ietf.org/rfc/rfc4122.txt) and [RFC 9562](https://datatracker.ietf.org/doc/rfc9562/) compliant UUIDs: +The `sqlean-uuid` extension provides limited support for [RFC 4122](https://www.ietf.org/rfc/rfc4122.txt) and [RFC 9562](https://datatracker.ietf.org/doc/rfc9562/) compliant UUIDs. + +[Reference](#reference) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) + +## Reference + +Supported features: - Generate a version 4 (random) UUID. - Generate a version 7 (time-ordered, random) UUID. - Convert a 16-byte blob into a well-formed UUID string and vice versa. -UUIDv4 adapted from [uuid.c](https://sqlite.org/src/file/ext/misc/uuid.c) by D. Richard Hipp. UUIDv7 contributed by [Nguyễn Hoàng Đức](https://github.com/nghduc97). - [uuid4](#uuid4) • [uuid7](#uuid7) • [uuid7_timestamp_ms](#uuid7_timestamp_ms) • @@ -94,7 +100,11 @@ select hex(uuid_blob(uuid4())); -- 7192B1B452964E809500CF0364476CD3 ``` -## Installation and Usage +## Acknowledgements + +UUIDv4 adapted from [uuid.c](https://sqlite.org/src/file/ext/misc/uuid.c) by D. Richard Hipp. UUIDv7 contributed by [Nguyễn Hoàng Đức](https://github.com/nghduc97). + +## Installation and usage SQLite command-line interface: @@ -103,8 +113,10 @@ sqlite> .load ./uuid sqlite> select uuid4(); ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/docs/vsv.md b/docs/vsv.md index 9e2b82a3..7f747ca6 100644 --- a/docs/vsv.md +++ b/docs/vsv.md @@ -1,8 +1,11 @@ -# vsv: CSV Files as Virtual Tables in SQLite +# vsv: CSV files as virtual tables in SQLite -Provides virtual table for working directly with CSV files, without importing data into the database. Useful for very large datasets. +The `sqlean-vsv` extension provides virtual table for working directly with CSV files, without importing data into the database. Useful for very large datasets. -Adapted from [vsv.c](http://www.dessus.com/files/vsv.c) by Keith Medcalf. +[Example](#example) • +[Parameters](#parameters) • +[Acknowledgements](#acknowledgements) • +[Installation and usage](#installation-and-usage) ## Example @@ -167,7 +170,11 @@ escape sequence. Recognized escape sequences are: \xhh specific byte where hh is hexadecimal ``` -## Installation and Usage +## Acknowledgements + +Adapted from [vsv.c](https://github.com/ncruces/kmedcalf-sqlite/blob/main/vsv.c) by Keith Medcalf. + +## Installation and usage SQLite command-line interface: @@ -177,8 +184,10 @@ sqlite> create virtual table temp.vsv using vsv(...); sqlite> select * from vsv; ``` -See [How to Install an Extension](install.md) for usage with IDE, Python, etc. +See [How to install an extension](install.md) for usage with IDE, Python, etc. + +↓ [Download](https://github.com/nalgeon/sqlean/releases/latest) the extension. + +⛱ [Explore](https://github.com/nalgeon/sqlean) other extensions. -[⬇️ Download](https://github.com/nalgeon/sqlean/releases/latest) • -[✨ Explore](https://github.com/nalgeon/sqlean) • -[🚀 Follow](https://antonz.org/subscribe/) +★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features. diff --git a/src/vsv/extension.c b/src/vsv/extension.c index d759d5dc..9b85ace9 100644 --- a/src/vsv/extension.c +++ b/src/vsv/extension.c @@ -1,5 +1,5 @@ // vsv extension by Keith Medcalf, Public Domain -// http://www.dessus.com/files/vsv.c +// https://github.com/ncruces/kmedcalf-sqlite/blob/main/vsv.c // Modified by Anton Zhiyanov, MIT License // https://github.com/nalgeon/sqlean/