Skip to content

Commit 215b312

Browse files
committed
docs tweaks
1 parent 44ec5a6 commit 215b312

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

docs/guide.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ But this plan strongly depends on the contiguity assumption.
963963
)?;
964964

965965
// dbconn: rusqlite::Connection with SQLITE_OPEN_URI
966-
let vacuum = dbconn
966+
let vacuum_sql = dbconn
967967
.genomicsqlite_vacuum_into_sql("compressed.db",
968968
&genomicsqlite_options)?;
969969
dbconn.execute_batch(&vacuum_sql)?;
@@ -1041,7 +1041,7 @@ The encoding is case-insensitive and considers `T` and `U` equivalent.
10411041

10421042
Given a TEXT value consisting of characters from the set `ACGTUacgtu`, compute a two-bit-encoded BLOB value that can later be decoded using `twobit_dna()` or `twobit_rna()`. Given any other ASCII TEXT value (including empty), pass it through unchanged as TEXT. Given NULL, return NULL. Any other input is an error.
10431043

1044-
Typically used to populate a BLOB column `C` with `INSERT INTO some_table(...,C) VALUES(...,nucleotides_twobit(?))`. This works even if some of the sequences contain `N`s or other characters, in which case those sequences are stored as the original TEXT values. Make sure the column has schema type `BLOB` to avoid spurious coercions.
1044+
Typically used to populate a BLOB column `C` with `INSERT INTO some_table(...,C) VALUES(...,nucleotides_twobit(?))`. This works even if some of the sequences contain `N`s or other characters, in which case those sequences are stored as the original TEXT values. Make sure the column has schema type `BLOB` to avoid spurious coercions, and by convention, the column should be named *_twobit.
10451045

10461046
**↪ Two-bit decoding**
10471047

@@ -1057,7 +1057,7 @@ Given a two-bit-encoded BLOB value, decode the nucleotide sequence as uppercased
10571057

10581058
The optional `Y` and `Z` arguments can be used to compute [`substr(twobit_dna(X),Y,Z)`](https://sqlite.org/lang_corefunc.html#substr) more efficiently, without decoding the whole sequence. Unfortunately however, [SQLite internals](https://sqlite.org/forum/forumpost/756c1a1e48?t=h) make this operation still liable to use time & memory proportional to the full length of X, not Z. If frequent random access into long sequences is needed, then consider splitting them across multiple rows.
10591059

1060-
Take care to only use BLOBs originally produced by `nucleotides_twobit()`, as other BLOBs may decode to garbage nucleotide sequences. If you `SELECT twobit_dna(C) FROM some_table` on a column with mixed BLOB and TEXT values as suggested above, note that the results actually stored as TEXT preserve their case and T/U letters, unlike decoded BLOBs.
1060+
Take care to only use BLOBs originally produced by `nucleotides_twobit()`, as other BLOBs may decode to spurious nucleotide sequences. If you `SELECT twobit_dna(C) FROM some_table` on a column with mixed BLOB and TEXT values as suggested above, note that the results actually stored as TEXT preserve their case and T/U letters, unlike decoded BLOBs.
10611061

10621062
**↪ Two-bit sequence length**
10631063

@@ -1072,12 +1072,7 @@ Given a TEXT value, return its byte length. Given NULL, return NULL. Any other i
10721072

10731073
#### JSON functions
10741074

1075-
The Genomics Extension bundles the SQLite developers' [JSON1 extension](https://www.sqlite.org/json1.html) and enables it automatically. The following conventions are recommended,
1076-
1077-
1. JSON object columns should be named *_json with type `TEXT DEFAULT '{}'`.
1078-
2. JSON array columns should be named *_jsarray with type `TEXT DEFAULT '[]'`.
1079-
1080-
The JSON1 functions can be used with [generated columns](https://sqlite.org/gencol.html) to effectively enable indices on JSON-embedded fields.
1075+
The Genomics Extension bundles the SQLite developers' [JSON1 extension](https://www.sqlite.org/json1.html) and enables it automatically. By convention, JSON object columns should be named *_json and JSON array columns should be named *_jsarray. The JSON1 functions can be used with [generated columns](https://sqlite.org/gencol.html) to effectively allow indexing of JSON-embedded fields.
10811076

10821077
#### Genomics Extension version
10831078

docs/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ Our **[Colab notebook](https://colab.research.google.com/drive/1OlHPOcRQBhDmEnS1
2222

2323
**To use the Genomics Extension you might first need to upgrade SQLite itself.** The host program must link [SQLite version 3.31.0 (2020-01-22)](https://www.sqlite.org/releaselog/3_31_0.html) or newer. In your shell, `sqlite3 --version` displays the version installed with your OS, which is probably what your programs use; if in doubt, cause a program to report the result of `SELECT sqlite_version()`.
2424

25-
If this is too old, then upgrade the system/environment SQLite3 library if possible & applicable. Otherwise, modify your program's linking step or runtime environment to cause it to use an up-to-date version, for example by setting rpath or LD_LIBRARY_PATH/DYLD_LIBRARY_PATH to the location of an up-to-date shared library file. Resources:
25+
If this is too old, then upgrade SQLite3 using your preferred binary package manager (e.g. apt, yum, conda, brew), if possible. Otherwise, modify your program's linking step or runtime environment to cause it to use an up-to-date version, for example by setting rpath or LD_LIBRARY_PATH to the location of an up-to-date shared library file. Resources:
2626

2727
* [How To Compile SQLite](https://www.sqlite.org/howtocompile.html)
2828
* [DreamHost Knowledge Base - Installing a custom version of SQLite3](https://help.dreamhost.com/hc/en-us/articles/360028047592-Installing-a-custom-version-of-SQLite3)
29-
* [Ubuntu PPA](https://launchpad.net/~dqlite/+archive/ubuntu/stable) with `sqlite3`
3029
* [Rpmfind: libsqlite3](https://rpmfind.net/linux/rpm2html/search.php?query=libsqlite3&submit=Search+...&system=&arch=)
3130
* [Sqlite :: Anaconda Cloud](https://anaconda.org/anaconda/sqlite)
3231
* Homebrew [formula/sqlite](https://formulae.brew.sh/formula/sqlite), [formula-linux/sqlite](https://formulae.brew.sh/formula-linux/sqlite)

0 commit comments

Comments
 (0)