9 <text xmlns="http://www.w3.org/1999/xhtml"> |
9 <text xmlns="http://www.w3.org/1999/xhtml"> |
10 |
10 |
11 <p> |
11 <p> |
12 Recfile is the native format of <a href="https://www.gnu.org/software/recutils/">GNU Recutils</a>. |
12 Recfile is the native format of <a href="https://www.gnu.org/software/recutils/">GNU Recutils</a>. |
13 Recfiles are text files that contain records of various types. |
13 Recfiles are text files that contain records of various types. |
14 They are human-editable and serve as a simple databases. |
14 They are human-editable and serve as simple databases. |
15 <m:name/> support input and output in this format since v0.11. |
15 <m:name/> support input and output in this format since v0.11. |
16 </p> |
16 </p> |
17 |
17 |
18 |
18 |
19 <p> |
19 <p> |
75 because <m:name/> support only three data types (string, unsigned integer and boolean) in this version; |
75 because <m:name/> support only three data types (string, unsigned integer and boolean) in this version; |
76 this will be improved in later releases (more data types are planned before v1.0) |
76 this will be improved in later releases (more data types are planned before v1.0) |
77 </p> |
77 </p> |
78 |
78 |
79 <p> |
79 <p> |
|
80 Because some web browsers or tools can store the original URL in extended attributes while downloading a file, |
|
81 we can use <code>recsel</code> to find files downloaded from some particular domain: |
|
82 </p> |
|
83 <m:pre jazyk="bash"><![CDATA[find -print0 | relpipe-in-filesystem \ |
|
84 --file path \ |
|
85 --file size \ |
|
86 --file type \ |
|
87 --xattr xdg.origin.url --as url \ |
|
88 | relpipe-out-recfile \ |
|
89 | recsel -e 'url ~ "^https?://([^/]*\.)?archive\.org/"']]></m:pre> |
|
90 |
|
91 <p> |
80 <m:name/> can be also used together with <a href="https://sql-dk.globalcode.info/">SQL-DK</a> (in 2019-03-05 development version) |
92 <m:name/> can be also used together with <a href="https://sql-dk.globalcode.info/">SQL-DK</a> (in 2019-03-05 development version) |
81 to pipe data from big relational databases like PostgreSQL or MariaDB to other formats like recfiles. |
93 to pipe data from big relational databases like PostgreSQL or MariaDB to other formats like recfiles. |
82 Having a script: |
94 Having a script: |
83 </p> |
95 </p> |
84 |
96 |
85 <m:pre jazyk="text" src="examples/sql-dk_pg_1.sh" odkaz="ano"/> |
97 <m:pre jazyk="bash" src="examples/sql-dk_pg_1.sh" odkaz="ano"/> |
86 |
98 |
87 <p> |
99 <p> |
88 We can convert result sets from any SQL queries to relational format and then work with such data without connection to the original database. |
100 We can convert result sets from any SQL queries to relational format and then work with such data without connection to the original database. |
89 Thus we can cache (<em>materialize</em>) the results locally in a file and use them even offline. |
101 Thus we can cache (<em>materialize</em>) the results locally in a file and use them even offline. |
90 Or we can run the SQL query each time and have fresh data: |
102 Or we can run the SQL query each time and have fresh data: |