sqlite3¶
vb sql|sqlite3 [OPTIONS]
Description¶
Run the sqlite3 command-line shell on the VisionByte repository
identified by the -R option, or on the current repository.
See https://www.sqlite.org/cli.html for additional information about
the sqlite3 command-line shell.
WARNING: Careless use of this command can corrupt a VisionByte repository
in ways that are unrecoverable. Be sure you know what you are doing before
running any SQL commands that modify the repository database. Use the
--readonly option to prevent accidental damage to the repository.
All of the standard sqlite3 command-line shell options should also work.
The following SQL extensions are provided with this VisionByte-enhanced version of the sqlite3 command-line shell:
builtin A virtual table that contains one row for
each datafile that is built into the VisionByte
binary.
checkin_mtime(X,Y) Return the mtime for the file Y (a BLOB.RID)
found in check-in X (another BLOB.RID value).
compress(X) Compress text X with the same algorithm used
to compress artifacts in the BLOB table.
content(X) Return the content of artifact X. X can be an
artifact hash or hash prefix or a tag. Artifacts
are stored compressed and deltaed. This function
does all necessary decompression and undeltaing.
decompress(X) Decompress text X. Undoes the work of
compress(X).
delta_apply(X,D) Apply delta D to source blob X and return
the result.
delta_create(X,Y) Create and return a delta that will convert
X into Y.
delta_output_size(D) Return the number of bytes of output to expect
when applying delta D
delta_parse(D) A table-valued function that deconstructs
delta D and returns rows for each element of
that delta.
files_of_checkin(X) A table-valued function that returns info on
all files contained in check-in X. Example:
SELECT * FROM files_of_checkin('trunk');
helptext A virtual table with one row for each command,
webpage, and setting together with the built-in
help text.
now() Return the number of seconds since 1970.
obscure(T) Obfuscate the text password T so that its
original value is not readily visible. VisionByte
uses this same algorithm when storing passwords
of remote URLs.
regexp The REGEXP operator works, unlike in
standard SQLite.
symbolic_name_to_rid(X) Return the BLOB.RID corresponding to symbolic
name X.
Options¶
- --no-repository¶
Skip opening the repository database
- --readonly¶
Open the repository read-only. No changes are allowed. This is a recommended safety precaution to prevent repository damage.
- -R REPOSITORY¶
Use REPOSITORY as the repository database
- --test¶
Enable some testing and analysis features that are normally disabled.
Examples¶
Init and open a repository
$ vb init sql_repo.vbyte
project-id: 7ff946b8067555ce4eca51f14197be2d3c78bcaa
server-id: 7bff8ccad644b20b8b66229efd4c9c7e1bc87c8d
admin-user: ubuntu (initial remote-access password is "F7kjWaheco")
$ vb open -f sql_repo.vbyte
project-name: <unnamed>
repository: /tmp/sphinx_tests/766ef654/sql_repo/sql_repo.vbyte
local-root: /tmp/sphinx_tests/766ef654/sql_repo/
config-db: /tmp/sphinx_tests/766ef654/.visionbyte
project-code: 7ff946b8067555ce4eca51f14197be2d3c78bcaa
checkout: adc3840f2345d92da63c17d67c8bd355dd866256 2026-03-31 13:00:39 UTC
tags: trunk
comment: initial empty check-in (user: ubuntu)
check-ins: 1
Run several read-only SQL queries against the repository
$ vb sql --readonly "SELECT name, type FROM sqlite_schema WHERE type IN ('table','view') ORDER BY name LIMIT 10;"
'attachment','table'
'backlink','table'
'blob','table'
'cherrypick','table'
'concealed','table'
'config','table'
'delta','table'
'event','table'
'filename','table'
'leaf','table'
$ vb sql --readonly "SELECT * FROM builtin LIMIT 5;"
'accordion.js',1329,X'766172206163635f73766764617461203d205b22646174613a696d6167652f7376672b786d6c2c222b0a2225334373766720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f737667272076696577426f783d2730203020313620313627253345222b0a2225334370617468207374796c653d2766696c6c3a626c61636b3b6f7061636974793a302720643d274d31362c3136483056306831367631367a272f253345222b0a2225334370617468207374796c653d2766696c6c3a726762283234302c3234302c323430292720643d274d31342c3134483256326831327631327a272f253345222b0a2225334370617468207374796c653d2766696c6c3a7267622836342c36342c3634292720643d274d31332c3133483356336831307631307a272f253345222b0a2225334370617468207374796c653d2766696c6c3a726762283234382c3234382c323438292720643d274d31322c313248345634683876387a272f253345222b0a2225334370617468207374796c653d2766696c6c3a7267622838302c3132382c323038292720643d27222c2022272f2533452533432f737667253345222c0a224d352c376832762d326832763268327632682d327632682d32762d32682d327a222c20224d31312c3948355637683676367a225d3b0a7661722061203d20646f63756d656e742e676574456c656d656e74734279436c6173734e616d6528226163636f7264696f6e22293b0a666f722876617220693d303b20693c612e6c656e6774683b20692b2b297b0a76617220696d67203d20646f63756d656e742e637265617465456c656d656e742822696d6722293b0a696d672e737263203d206163635f737667646174615b305d2b6163635f737667646174615b325d2b6163635f737667646174615b315d3b0a696d672e636c6173734e616d65203d20226163636f7264696f6e5f62746e206163636f7264696f6e5f62746e5f706c7573223b0a615b695d2e696e736572744265666f726528696d672c615b695d2e66697273744368696c64293b0a696d67203d20646f63756d656e742e637265617465456c656d656e742822696d6722293b0a696d672e737263203d206163635f737667646174615b305d2b6163635f737667646174615b335d2b6163635f737667646174615b315d3b0a696d672e636c6173734e616d65203d20226163636f7264696f6e5f62746e206163636f7264696f6e5f62746e5f6d696e7573223b0a615b695d2e696e736572744265666f726528696d672c615b695d2e66697273744368696c64293b0a615b695d2e6164644576656e744c697374656e65722822636c69636b222c66756e6374696f6e28297b0a7661722078203d20746869732e6e657874456c656d656e745369626c696e673b0a69662820746869732e636c6173734c6973742e636f6e7461696e7328226163636f7264696f6e5f636c6f736564222920297b0a782e7374796c652e6d6178486569676874203d20782e7363726f6c6c486569676874202b20227078223b0a73657454696d656f75742866756e6374696f6e28297b0a782e7374796c652e6d6178486569676874203d2022223b0a7d2c323530293b0a7d656c73657b0a782e7374796c652e6d6178486569676874203d20782e7363726f6c6c486569676874202b20227078223b0a73657454696d656f75742866756e6374696f6e28297b0a782e7374796c652e6d6178486569676874203d202230223b0a7d2c31293b0a7d0a746869732e636c6173734c6973742e746f67676c6528226163636f7264696f6e5f636c6f73656422293b0a7d293b0a7d0a'
'alerts/bflat2.wav',1620,X'524946464c06000057415645666d74201000000001000100401f0000401f00000100080064617461280600008080808081818284848585858585848281807e7b7a7876757271717071727376787b7f8286898d909496979898979694908c87827d77726c6864615f5d5d5f6164696e757b828990979da3a7aaacacaba7a39e978f877e756b635c554f4c4a4a4b4e535a626b76808b959fa9b1b8bcbfc0bdbab4ada49a8e8175685c5247403b3736373b424a54606e7b8998a5b2bdc7ced1d3d2cec7bfb3a59687776758493c3129252223272e38445363758798aabac8d5dee4e7e6e3dad0c3b3a28f7b68544333251a120f0f121a263445586c8196aabccedce6eef2f2eee6dccebdab96816c594535261a120d0d1017212f3f52657a8fa4b7c8d7e3ecf0f2efe9dfd2c3b19d88735f4b392a1e140f0d0f141e2a394b5f73889db1c2d2dfe9eff2f0ece3d7c8b7a48f7a65523f2f2117100d0d121a263545596c8196abbdcedce6eef2f2eee6dccebcaa96816c584534261a120d0d1118222f3f52657a8fa4b8c9d7e4ecf0f2efe9dfd2c2b09c88725f4b392a1e140f0d0f141e2a3b4c6075899db1c3d3e0e9eff2f0ece3d7c8b7a38e7964513e2f2117100d0d121a263546596e8297abbdcedce7eef2f2eee6dacdbcaa95806b584434251a120d0d111822304053677b90a5b8c9d8e4ecf2f2efe8dfd1c2b09c87725d4a38291d140f0d0f141f2c3b4c6075899eb2c3d3e0e9f0f2f0ece3d6c7b5a28e7964513e2e2117100d0d121b2735465a6e8297acbfcfdde7eef2f2ede6dacdbba995806b5644332519120d0d111822304053687d91a5b9c9d8e4ecf2f2efe8ded1c1ae9b86715d4a38291d130f0d0f161f2c3c4d61768b9fb2c4d3e0e9f0f2f0ebe3d6c7b5a28d7863513f2f231a14121319212d3b4b5d708496a7b8c7d2dae0e3e3ded7cdc0b2a2907f6e5d4e42362e28262729303844515f6e7e8d9ca9b5c0c7cdcfcfcdc7c0b7ab9e918476695c5249423d39393c40464e58636f7a86919ca5adb4b9bbbbbab7b2aba39a90867b7269615a54514d4d4e51555b61697179818991979da2a5a7a9a7a5a29e98938d867f79736e6965636161616365696c71767a7f84888c8f919494959493918f8d898684807e7a79777675757575767778797a7d7e7f80818182828281818080807f807f80807f80807f807f807f80807f80807f807f8080807f807f807f807f807f80807f807f807f807f80807f807f807f807f807f807f807f80807f807f80807f807f807f807f807f807f807f808080807f807f807f807f807f807f80807f80807f807f807f80807f807f807f807f807f80808080808080808080807f807f80807f807f80807f807f80807f80807f807f80807f80807f807f807f80807f807f80807f8080807f808080807f80807f807f807f807f807f807f808080808080807f807f807f807f807f807f807f807f807f80807f807f7f807f807f807f80807f807f807f807f807f80807f807f807f80807f807f807f80808080807f807f80807f807f807f80807f80807f807f807f8080807f80807f807f807f80807f807f807f80807f80807f807f807f807f80807f807f80807f807f807f807f80807f807f8080807f807f807f807f807f80808080807f80807f807f807f807f80807f807f807f807f80807f807f80807f807f807f807f807f807f80807f807f80807f807f807f807f807f8080807f80807f80807f807f807f807f7f807f80807f807f807f8080807f807f80807f807f807f807f807f807f807f807f80807f807f807f807f80807f807f807f80807f807f808080807f807f807f80807f807f807f8080807f807f8080807f807f807f7f807f8080807f807f807f807f807f807f80807f80808080808080807f808080807f80808080807f807f80808080807f807f807f807f807f8080807f807f807f807f807f807f807f807f807f807f807f80807f807f807f807f8080807f807f807f80807f807f807f807f807f807f807f80807f807f7f807f807f807f80807f807f807f807f807f807f7f807f807f7f80808080807f807f807f807f7f807f8080807f807f807f807f807f808080807f8080807f807f807f807f807f807f7f807f807f807f807f807f807f80807f807f80808080807f807f80808080807f80808080807f807f807f80808080807f807f7f807f807f807f80807f807f80808080807f8080808080807f807f807f807f7f807f8080808080807f80807f807f'
'alerts/bflat3.wav',1620,X'524946464c06000057415645666d74201000000001000100401f0000401f00000100080064617461280600008080818284858584817e7a7672717173787f868d9497989690877d7268615d5e646e7b8997a3aaaca79e8f7e6b5c4f4a4b5362768b9fb1bcc0baad9a81685240373742546e89a5bdced3cebfa58767483125232e446387aac8dee7e3d0b38f684325120f1a345881aacee6f2eedcbd966c4526120d172f527aa4c8e3f0efdfc39d734b2a140d142a4b739dc2dfeff0e3c8a47a522f170d1226456c96bddceef2e6ceaa8158341a0d11223f658fb8d7ecf2e9d2b0885e391e0f0f1e3b6089b1d3e9f2ecd7b78e643e21100d1a355982abcee7f2eedabc956b4425120d1830537ba5c9e4f2efdfc29c724a29140d142c4c749ec3e0f0f0e3c7a279512e170d1227466e97bfddeef2e6cda9805632190d1122406891b9d8ecf2e8d1ae865d381c0f0f1f3c618ab2d3e9f2ebd6b58d633d20100d1b365a84accfe7f2eddabb946a4325110d1831547da6cae5f2efdec19b714828130d162c4e769fc4e1f0f0e1c6a1784f2d160d1328476f98c0ddeef2e5cba77e5531190d1123426993bad9edf2e8d0ad855c371c0f10203c628cb4d5ebf2ebd5b48c623d20100f1c375b85add0e8f2edd9ba93694223110d1931557ea7cbe5f2eeddc09a704728130d162d4f77a1c6e1f0f0e1c49f764e2c160d132848719bc1deeff2e5caa67d5431180d1125436a94bbdaedf2e7cfac845a361b0f10203d638db5d6ebf2ebd3b38a613c1f100f1c385d86aed1e8f2edd8b991684022110d1932567fa9cde6f2eeddbf976e4627130d172e5179a2c7e3f0f0e0c49e744d2c160d14294a729cc1dfeff2e4c9a57b5330180d1225446b95bcdaeef2e7ceab8259351a0d10213e648eb7d7ecf2e9d3b289603b1e0f0f1e395e87b0d2e9f2ecd7b890673f22110d1a345881aacde6f2eedcbd966c4526120d172f527aa3c8e3f0efdfc39d734c2a140d142a4b739dc2dfeff0e3c8a47a522f170d1226456c96bddceef2e6ceaa8158341a0d112240678fb4d2e5e9dfcaab8763432d21222f476587a6c0d0d6d0bfa68a6c533f35353e4f67819aaebcc2bfb3a08c74615248474d5a6b7e909faaaeaca5988a7a6c625c5b5e67717d8891979b9a958e877e77726f6f7074797e8285878786858281807f8080807f807f807f80807f807f807f80807f807f80807f8080807f807f80808080807f807f80807f80807f807f807f807f80807f807f80807f807f80808080807f808080807f808080807f807f807f807f80807f807f80807f80807f807f808080807f807f807f8080807f80807f807f807f80807f807f80807f807f8080807f807f8080807f80807f807f80808080807f807f807f80807f808080807f80808080808080808080808080808080808080807f807f80807f807f807f807f807f807f80807f807f807f807f807f807f7f80807f807f807f807f80807f807f807f80807f80807f807f80807f80807f807f807f807f807f807f80807f807f807f807f807f807f807f80807f807f807f80807f807f807f80807f807f80807f807f807f807f807f80807f807f807f807f80807f807f80807f80807f807f8080807f807f807f80807f807f807f807f807f807f807f807f80807f807f807f80807f807f7f807f807f8080807f807f807f807f8080807f807f807f8080807f807f807f807f807f80807f807f807f807f80807f807f807f807f807f807f807f807f80807f807f807f807f807f8080807f807f807f807f807f807f8080807f807f807f807f807f80807f80807f80807f807f807f808080807f807f807f7f807f807f8080807f807f807f80807f807f80808080807f807f807f807f80808080807f807f807f80807f807f807f807f807f807f807f80807f807f80807f807f807f8080808080808080808080807f80807f807f807f807f807f80807f807f807f807f807f807f807f807f807f80808080807f807f8080807f807f8080807f807f807f7f807f80808080807f80808080807f80807f807f80807f80807f807f807f807f807f807f808080807f807f807f807f80807f80807f807f80807f80807f807f807f8080807f807f8080807f807f80807f807f80807f807f80807f807f807f7f807f7f807f80807f80808080807f807f807f80808080807f807f807f807f80808080807f807f807f807f80808080807f807f80807f807f8080808080807f807f807f807f80807f7f807f807f807f'
'alerts/bloop.wav',1620,X'524946464c06000057415645666d74201000000001000100401f0000401f0000010008006461746128060000808080828182817f7d7c7b797b7e8285888a8a86817d77747274787e858c91928e888077706c6a6f77828c94999992887c706762656d7987949da19d938575665d5b616d7e8f9ea8a8a0927e6a5b53545f70869aaab0ada18c7560514b51607791a6b4b8b09d84695345445065809cb3bfbeb097795d473c40516d8dabc0c8c1ac8d6c4e3a343e57789cbacdcfc1a4805b3e2e2e416086acc9d7d2bc9a714b2f242c476d97bed7dfd2b48c5f39221d2e507daacfe4e5cfa97b4b27161a345e8fbee0eee6c89a6638170e1c3e6fa3d0ecf2dfb98653291010265083b5ddf0edd2a672411d0e16346297c7e7f2e5c3935f32150e1f4476aad5eef0dab27f4c240f112b578bbce1f2ebcda06c3b1a0e1a3a699ecbe9f2e1be8c582c130f234b7eb1d9efeed6ab7845200e14315e92c2e5f2e7c8996535160e1c4071a5d1edf0deb78551271010275185b7def0edd1a570401c0e17356599c8e8f2e5c2925e31140e204778acd6eeefd9b17d4b230f132c588cbee1f2e9cb9e693a180e1a3b6ca0ceebf2e1bb8b572b110f244c7fb2daf0ee3c24140e13223958799dbcd7e9f2efe3cdaf8d69492d1a0f0f1a2e4a6c8eb1cee4eff2e8d6bb9b78563820110e14253f5e80a3c2dcecf2eedfc7a986634329160e101d33507295b5d2e6f0f0e6d1b6957150331d100e1629436387a9c8dfeef2ecdcc2a3805e3d25140e11203856789bbbd6e9f2efe3cdb08e6c4a2e1a0f0f1a2d496a8dafcde3eff2ead7bc9c79573920110e14243d5d7fa2c1daecf2eee0c8aa8865442a170e101c324f7094b4d1e6f0f0e7d2b7967451341d100e1627426285a8c7deedf2ecdcc3a4825f4127171116243a577799b7cfe0e8e6dac7ac8e6f5239271e1e2739516d8aa5bed0dadcd5c7b1977c614a382c292e3a4e657e97afc0cdd1cec3b39e866f59473a35363f4c60758ba0b2bec5c5beb2a18e79665649424145505e6f8194a4b0b8b9b7ada292827062574f4c4d545f6d7c8b97a3aaadaca89e9386796d625b58585b636d77838e979ea2a2a09a92887f766e68636365696f777f868d93959695938d88827c7672706f6f7175797e8286888b8b8b8a8785817f7d7c7b7b7b7c7d7e7f80808080807f80807f807f807f807f807f807f807f807f7f807f807f7f807f807f807f7f807f807f807f807f8080807f807f807f807f807f807f807f807f80807f807f807f80807f80807f80807f807f80807f807f80807f807f80807f807f807f807f80807f807f807f7f807f807f807f807f807f808080807f8080807f7f807f80807f807f807f807f80807f807f807f807f807f807f807f807f807f80807f807f807f807f7f807f80807f807f80807f807f80807f807f80807f807f807f7f807f807f807f80807f80807f807f80807f807f807f807f808080807f7f807f807f808080808080807f807f807f807f807f80807f80807f807f807f80807f807f807f80808080807f807f807f807f807f8080807f807f807f8080807f807f807f807f7f807f807f807f80807f807f80807f80807f807f807f807f80807f807f807f807f80807f807f807f807f8080807f807f807f807f807f807f807f807f807f807f807f808080807f807f8080807f80807f807f807f807f807f8080807f807f7f807f807f807f8080807f807f807f807f807f80807f80807f80807f80807f807f807f80807f807f807f807f808080807f80807f807f8080807f80808080807f807f807f807f807f80807f807f807f807f807f807f807f808080807f807f807f80807f807f807f807f807f807f80807f807f807f80807f807f807f807f807f7f807f807f7f80807f807f80807f807f807f807f807f8080807f807f7f807f807f7f807f807f807f80807f807f807f80807f80807f808080807f80807f807f807f807f807f807f807f80807f807f807f807f8080807f807f8080807f807f8080807f807f80807f807f807f807f807f807f80807f807f807f807f807f807f80807f7f807f80807f807f807f80807f807f80807f807f808080807f807f807f80807f807f807f807f807f807f80807f807f80807f807f80807f80807f807f807f8080807f80807f807f807f8080807f80807f807f807f8080807f80807f807f7f808080807f7f80808080807f807f807f807f8080807f807f80807f80807f807f807f807f807f807f807f7f807f80'
'alerts/plunk.wav',1650,X'524946466a06000057415645666d74201000000001000100401f0000401f0000010008004c4953541a000000494e464f495346540e0000004c61766635382e34322e31303000646174612406000080808080807f7f7f7f8080807f80808080807f7f7f808080807f7f7f7f8080807f80807f7f7f7f7f808080807f7f807f7f8080807f807f7f7f807f7f80807f7f8282827d797c7f8385847f7c7c7f858287979e6a44576874a7d0d8ab623d372c2743a1ecede9d39e59160f102570b5eef3ead9872f0b0f12277de0fcebe0bf812f0d13286aa2cbe4e4bd7b422e3747628fc0d7c49a71543f354575aecdcebfa2733b191f4778a6d2ece5b9764121141f498dcdebead3a5682811193c76a8d6ece3b4703e2523335d96c8ddd0b18b603725355e8eb2cad1be935f3a313d5980accbcfb791694b3635517fa9c1c3b79d774f383d567795b0c3bfa37b5b4a444b6187afc2bba58b6d4f3f476385a0b3b9af926c504750657e9ab2b8a98c6f5b4f4f61809fb0b0a28c735b4e53688197a8aea790725b5256647b95aab0a48e78645553607993a3a9a396806757576375899ca7a4947f6e635e637085979f9c928475676167768692999a92837267666c76828f99999084776d6767707f8f979893897c6e6667707d899297958b7e736c6a6d77838f95938d84796f6b6d76818b92918c847a726e717780888e908c847b7470717780898e8f8a837a726f7177818a90908b847b726d6f7780888e9290877c736f6f737a838d918f89827b747172787f868a8b8a857d787677797d83878886827d7978797c82868785837f7b77777a7f84878888847f7a7776787c80868a8a87817c7876767a7f8487878684807b78797b7e8083858584817e7c7a7a7c8083848383827f7c7a7b7e8081838484807c7b7c7d7e80838585827f7d7b7a7a7c8084858584827f7b79797b7e8083858685827f7d7b797a7d7f8283848483817f7d7b7b7b7d7f8284848382807e7b7b7c7e8082838382817f7d7c7d7e7f81818282807f7d7d7d7e7f828383817f7d7c7c7c7e8183848483807d7b7a7b7e8082848584817d7b7a7b7d8083848483817e7b7a7b7d8083858684817e7c7a7a7b7e8285858483807d7b7a7c7e8082848483807d7b7b7b7d8083858583807d7a797a7d8082848585827e7b7a7a7c7e8184858483807e7c7a7b7d808283838382807d7c7c7d7e7f828383817f7e7d7d7d7f81828282817f7d7c7c7e8082838483817d7b7b7b7d8082858583817f7d7b7a7b7e8284858583807d7a7a7b7d8083858583807d7b7a7b7d8082848584817e7b7a7b7d7f81848584827f7d7b7a7c7e8184848482807d7b7a7b7e8082848484817e7c7c7b7c7e8183848382807f7d7c7c7d7f8182838281807e7e7e7e7e7f80818180807f7e7e7e7f8081818181807e7d7d7e7f8081828281807e7d7d7d7e808182828181807f7d7d7d7e8081828281807f7e7e7e7e7f8081828180807f7e7d7e7f8081818181807f7e7e7e7f7f8080818180807f7f7f7f8080808080807f7f7f7f7f8080808080807f7f7f7f7f8080808180807f7f7e7f7f7f7f80818181807f7e7e7e7f7f8081818180807f7e7e7e7f8081818180807f7e7e7f7f8080818181807f7e7e7e7e7f80818281817f7e7d7d7e7f8181828181807e7d7e7e7f80818282817f7e7d7d7d7f8182828281807f7d7d7d7e8081828282807f7e7e7d7e7f8081828181807f7e7e7e7f8080818181807f7e7e7e7f8081818181807f7e7e7e7f8080818180807f7f7e7e7f8080818181807f7e7e7e7f7f80818181807f7f7e7e7f7f80818181807f807f807f807f807f808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080'