2016-04-12 23:06:56 +00:00
<!DOCTYPE html>
< html dir = "ltr" >
< head >
< meta http-equiv = "content-type" content = "text/html;charset=UTF-8" / >
< title > Dev/Database/Shell/File - XOWA< / title >
2016-04-16 01:06:56 +00:00
< link rel = "shortcut icon" href = "https://gnosygnu.github.io/xowa/xowa_logo.png" / >
< link rel = "stylesheet" href = "https://gnosygnu.github.io/xowa/xowa_common.css" type = "text/css" >
2016-04-12 23:06:56 +00:00
< / head >
< body class = "mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck = "false" >
< div id = "mw-page-base" class = "noprint" > < / div >
< div id = "mw-head-base" class = "noprint" > < / div >
< div id = "content" class = "mw-body" >
< h1 id = "firstHeading" class = "firstHeading" > < span > Dev/Database/Shell/File< / span > < / h1 >
< div id = "bodyContent" class = "mw-body-content" >
< div id = "siteSub" > From XOWA: the free, open-source, offline wiki application< / div >
< div id = "contentSub" > < / div >
< div id = "mw-content-text" lang = "en" dir = "ltr" class = "mw-content-ltr" >
< p >
2016-04-16 01:06:56 +00:00
< a href = "http://xowa.org/wiki/home/page/Template:Css/Sqlite.html" id = "xolnki_2" title = "Template:Css/Sqlite" > Template:Css/Sqlite< / a >
2016-04-12 23:06:56 +00:00
< / p >
< h3 >
< span class = "mw-headline" id = "Get_the_file" > Get the file< / span >
< / h3 >
< ul >
< li >
2016-04-16 01:06:56 +00:00
launch sqlite3 shell. See < a href = "http://xowa.org/wiki/home/page/Dev/Sqlite/Shell.html" id = "xolnki_3" title = "Dev/Sqlite/Shell" > Dev/Sqlite/Shell< / a >
2016-04-12 23:06:56 +00:00
< / li >
< li >
Turn on some options
< / li >
< / ul >
< pre class = 'sqlite-sql' >
-- enables column headers
.header on
-- enables column view
.mode column
.width 40 80
< / pre >
< ul >
< li >
Get a list of thumbs and their database
< / li >
< / ul >
< pre class = 'sqlite-sql' >
SELECT f.fil_name
, t.thm_w
, tb.dbb_url
FROM fsdb_fil f
JOIN fsdb_thm t ON f.fil_id = t.thm_owner_id
JOIN fsdb_dbb tb ON t.thm_bin_db_id = tb.dbb_uid
WHERE f.fil_name LIKE 'Earth%'
LIMIT 10
;
< / pre >
< dl >
< dd >
The following output should be returned
< / dd >
< / dl >
< pre >
dbb_url fil_name
---------------------------------------- --------------------------------------------------------------------------------
en.wikipedia.org-file-ns.000-db.001.xowa Earth_from_Apollo_11_after_translunar_injection.jpg
en.wikipedia.org-file-ns.000-db.001.xowa Earth-moon.jpg
en.wikipedia.org-file-ns.000-db.001.xowa Earth-moon.jpg
en.wikipedia.org-file-ns.000-db.001.xowa Earth_Day_Flag.png
en.wikipedia.org-file-ns.000-db.001.xowa Earth_precession.jpg
en.wikipedia.org-file-ns.000-db.001.xowa Earth_Day_Flag.png
en.wikipedia.org-file-ns.000-db.001.xowa Earthenware_architecture_models,_Eastern_Han_Dynasty,_5.JPG
en.wikipedia.org-file-ns.000-db.001.xowa Earth_coordinates.PNG
en.wikipedia.org-file-ns.000-db.001.xowa Earth_symbol.svg
en.wikipedia.org-file-ns.000-db.001.xowa Earth-cutaway-schematic-english.svg
< / pre >
< ul >
< li >
Output some thumbs to the file-system
< / li >
< / ul >
< pre >
ATTACH 'en.wikipedia.org-file-ns.000-db.001.xowa' AS 'bin_db';
SELECT writefile(Cast(t.thm_size AS varchar(10)) || 'px-' || f.fil_name, tb.bin_data) AS file_data
FROM fsdb_fil f
JOIN fsdb_thm t ON f.fil_id = t.thm_owner_id
JOIN bin_db.fsdb_bin tb ON t.thm_id = tb.bin_owner_id
WHERE fil_name = 'Earth-moon.jpg';
DETACH 'bin_db';
< / pre >
< ul >
< li >
See a listing of the files
< / li >
< / ul >
< pre >
sqlite> .shell dir /b *px-*
497px-Earth-moon.jpg
644px-Earth-moon.jpg
< / pre >
< / div >
< / div >
< / div >
< div id = "mw-head" class = "noprint" >
< div id = "left-navigation" >
< div id = "p-namespaces" class = "vectorTabs" >
< h3 > Namespaces< / h3 >
< ul >
< li id = "ca-nstab-main" class = "selected" > < span > < a id = "ca-nstab-main-href" href = "index.html" > Page< / a > < / span > < / li >
< / ul >
< / div >
< / div >
< / div >
< div id = 'mw-panel' class = 'noprint' >
< div id = 'p-logo' >
2016-04-16 01:30:18 +00:00
< a style = "background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href = "https://xowa.org/" title = "Visit the main page" > < / a >
2016-04-12 23:06:56 +00:00
< / div >
< div class = "portal" id = 'xowa-portal-home' >
< h3 > XOWA< / h3 >
< div class = "body" >
< ul >
2016-04-16 01:20:05 +00:00
< li > < a href = "http://xowa.org/index.html" title = 'Visit the main page' > Main page< / a > < / li >
< li > < a href = "http://xowa.org/screenshots.html" title = 'See screenshots of XOWA' > Screenshots< / a > < / li >
2016-04-16 01:06:56 +00:00
< li > < a href = "http://xowa.org/wiki/home/page/Help/Download_XOWA.html" title = 'Download the XOWA application' > Download XOWA< / a > < / li >
< li > < a href = "http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title = 'Download offline wikis and image databases' > Download wikis< / a > < / li >
2016-04-15 20:20:49 +00:00
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-stargin' >
< h3 > Getting started< / h3 >
< div class = "body" >
< ul >
2016-04-16 01:06:56 +00:00
< li > < a href = "http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title = 'Get XOWA's system requirements' > Requirements< / a > < / li >
< li > < a href = "http://xowa.org/wiki/home/page/App/Setup/Installation.html" title = 'Get instructions for installing XOWA' > Installation< / a > < / li >
< li > < a href = "http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title = 'Learn how to set up Simple Wikipedia' > Simple Wikipedia< / a > < / li >
< li > < a href = "http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title = 'Learn how to set up English Wikipedia' > English Wikipedia< / a > < / li >
< li > < a href = "http://xowa.org/wiki/home/page/App/Import/Other_wikis.html" title = 'Learn how to set up other Wikipedias' > Other Wikipedias< / a > < / li >
2016-04-12 23:06:56 +00:00
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-help' >
< h3 > Help< / h3 >
< div class = "body" >
< ul >
2016-04-16 01:06:56 +00:00
< li > < a href = "http://xowa.org/wiki/home/page/Help/About.html" title = 'Get more information about XOWA' > About< / a > < / li >
< li > < a href = "http://xowa.org/wiki/home/page/Help/Contents.html" title = 'View a list of help topics' > Contents< / a > < / li >
< li > < a href = "http://xowa.org/wiki/home/page/Help/Media.html" title = 'Read what others have written about XOWA' > Media< / a > < / li >
< li > < a href = "http://xowa.org/wiki/home/page/Help/Feedback.html" title = 'Questions? Comments? Leave feedback for XOWA' > Feedback< / a > < / li >
2016-04-12 23:06:56 +00:00
< / ul >
< / div >
< / div >
2016-04-15 20:20:49 +00:00
< div class = "portal" id = 'xowa-portal-blog' >
< h3 > Blog< / h3 >
< div class = "body" >
< ul >
2016-04-16 01:06:56 +00:00
< li > < a href = "http://xowa.org/wiki/home/page/Blog.html" title = 'Follow XOWA' ' s development process ' > Current< / a > < / li >
2016-04-15 20:20:49 +00:00
< / ul >
< / div >
< / div >
2016-04-12 23:06:56 +00:00
< div class = "portal" id = 'xowa-portal-links' >
< h3 > Links< / h3 >
< div class = "body" >
< ul >
< li > < a href = "http://dumps.wikimedia.org/backup-index.html" title = "Get wiki datababase dumps directly from Wikimedia" > Wikimedia dumps< / a > < / li >
< li > < a href = "https://archive.org/search.php?query=xowa" title = "Search archive.org for XOWA files" > XOWA @ archive.org< / a > < / li >
< li > < a href = "http://en.wikipedia.org" title = "Visit Wikipedia (and compare to XOWA!)" > English Wikipedia< / a > < / li >
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-donate' >
< h3 > Donate< / h3 >
< div class = "body" >
< ul >
< li > < a href = "https://archive.org/donate/index.php" title = "Support archive.org!" > archive.org< / a > < / li > <!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning - center - fire - please - help - rebuild/ -->
< li > < a href = "https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title = "Support Wikipedia!" > Wikipedia< / a > < / li >
<!-- <li><a href="" title="Support XOWA! (but only after you've supported archive.org and Wikipedia)">XOWA</a></li> -->
< / ul >
< / div >
< / div >
< / div >
< / body >
< / html >