You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide.md
+4-9Lines changed: 4 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -963,7 +963,7 @@ But this plan strongly depends on the contiguity assumption.
963
963
)?;
964
964
965
965
// dbconn: rusqlite::Connection with SQLITE_OPEN_URI
966
-
let vacuum = dbconn
966
+
let vacuum_sql = dbconn
967
967
.genomicsqlite_vacuum_into_sql("compressed.db",
968
968
&genomicsqlite_options)?;
969
969
dbconn.execute_batch(&vacuum_sql)?;
@@ -1041,7 +1041,7 @@ The encoding is case-insensitive and considers `T` and `U` equivalent.
1041
1041
1042
1042
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.
1043
1043
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.
1045
1045
1046
1046
**↪ Two-bit decoding**
1047
1047
@@ -1057,7 +1057,7 @@ Given a two-bit-encoded BLOB value, decode the nucleotide sequence as uppercased
1057
1057
1058
1058
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.
1059
1059
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.
1061
1061
1062
1062
**↪ Two-bit sequence length**
1063
1063
@@ -1072,12 +1072,7 @@ Given a TEXT value, return its byte length. Given NULL, return NULL. Any other i
1072
1072
1073
1073
#### JSON functions
1074
1074
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.
**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()`.
24
24
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:
26
26
27
27
*[How To Compile SQLite](https://www.sqlite.org/howtocompile.html)
28
28
*[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`
0 commit comments