relpipe-data/examples-in-filesystem-tr-sql-indexing.xml
branchv_0
changeset 297 192b0059a6c4
parent 281 0b6b1781a0a5
--- a/relpipe-data/examples-in-filesystem-tr-sql-indexing.xml	Thu May 21 01:23:23 2020 +0200
+++ b/relpipe-data/examples-in-filesystem-tr-sql-indexing.xml	Sat Jun 06 01:57:24 2020 +0200
@@ -26,7 +26,7 @@
 		
 		<m:pre jazyk="bash"><![CDATA[find /bin/ /usr/bin/ -print0 \
 	| relpipe-in-filesystem --relation "program" \
-	| relpipe-tr-sql --file bin.sqlite --file-keep true]]></m:pre>
+	| relpipe-tr-sql --data-source-string 'Driver=SQLite3;Database=file:bin.sqlite']]></m:pre>
 	
 		<p>
 			This index allows us to do fast searches and various analysis.
@@ -34,7 +34,7 @@
 		</p>
 		
 		<m:pre jazyk="bash"><![CDATA[relpipe-in-sql \
-	--file bin.sqlite \
+	--data-source-string 'Driver=SQLite3;Database=file:bin.sqlite' \
 	--relation "largest" \
 		"SELECT path, size FROM program WHERE type = 'f' ORDER BY size DESC LIMIT 20" \
 	| relpipe-out-tabular]]></m:pre>
@@ -75,7 +75,7 @@
 		</p>
 
 		<m:pre jazyk="bash"><![CDATA[relpipe-in-sql \
-		--file bin.sqlite \
+		--data-source-string 'Driver=SQLite3;Database=file:bin.sqlite' \
 		--relation bin "SELECT path FROM program WHERE type = 'f'" \
 	| relpipe-out-nullbyte \
 	| while read_nullbyte f; do 
@@ -85,12 +85,12 @@
 		"dependency" \
 			"program" string \
 			"library" string \
-	| relpipe-tr-sql --file bin.sqlite]]></m:pre>
+	| relpipe-tr-sql --data-source-string 'Driver=SQLite3;Database=file:bin.sqlite']]></m:pre>
 	
 		<p>And then we can make a „popularity contest“ and find 20 most often used libraries:</p>
 		
 		<m:pre jazyk="bash"><![CDATA[relpipe-in-sql \
-	--file bin.sqlite \
+	--data-source-string 'Driver=SQLite3;Database=file:bin.sqlite' \
 	--relation "popular_libraries" "
 		SELECT 
 			d.library, 
@@ -138,6 +138,11 @@
 			Extended attributes are already supported (the <code>--xattr</code> option).
 		</p>
 		
+		<p>
+			n.b. if we use a database frequently it is convenient to configure it as a data source in the <code>~/.odbc.ini</code> file
+			– and then connect to it using the <code>--data-source-name</code> option and its name.
+		</p>
+		
 	</text>
 
 </stránka>