This comprehensive guide offers detailed insights into the query syntax, aiming to help users grasp the various components and structures of different query types enabling them to perform efficient file, directory, and data search and delete operations using SQL-like commands.
FiSE offers two primary operations to its users namely Search and Delete. To get deep insight of these operations, please refer to the Operations guide.
(EXPORT (FILE[<FILEPATH>]|SQL[<DATABASE>])) (R|RECURSIVE) SEARCH[<PARAMETERS>] <FIELDS> FROM (RELATIVE|ABSOLUTE) (<FILEPATH>|<DIRECTORYPATH>) (WHERE <CONDITIONS>)(R|RECURSIVE) DELETE[<PARAMETERS>] FROM (RELATIVE|ABSOLUTE) (<FILEPATH>|<DIRECTORYPATH>) (WHERE <CONDITIONS>)-
EXPORT FILE[ FILEPATH ] or EXPORT SQL[ DATABASE ]:
-
This segment is optional and is used for exporting search records to a file or database.
-
NOTE: Currently, exporting records is only limited to search operations.
-
File Export: FiSE allows search records export only to the file formats mentioned below under the Available File Formats section below. To export to a file, the following rules must be followed:
- The file specified must be non-existant.
- The file name must be followed by a allowed suffix, FiSE recognizes the file export type explicitly based on the suffix of the file specified.
-
Available File Formats: csv, html, xlsx and json.
-
Available Databases: mysql, postgresql and sqlite.
-
Example:
EXPORT FILE[./results.csv]andEXPORT SQL[mysql]
-
-
R or RECURSIVE:
- This segment is optional and allows recursive inclusion of all the files and sub-directories present within the specified directory.
-
SELECT[ PARAMETERS ] or DELETE[ PARAMETERS ]:
-
This segments includes the operation specifications. Users can choose between two different query operations: Search and Delete.
-
Additional parameters can be specified to toggle between different file-types or file-modes, especially for data search operations. These can be defined within square brackets
[]adjoining the name of the operation where each parameter is seperated by commas. Refer to the Parameters Types section below to know more about the different types of parameters available for operation configuration. -
Parameters Types: The following are the different types of parameters which can be defined within the operation specifications:
-
TYPE: It is used to toggle between file, directory and data operation. The type can only be set to
datafor search operation and is not available for delete operations. To specify this parameter, use the following format:TYPE (FILE|DIR|DATA). Eg:SELECT[TYPE DIR]configures the operation to work with directories andDELETE[TYPE FILE]toggles the operation to work with files. -
MODE: It is used to toggle between text and bytes filemode. It is only limited to data search operations. To specify this parameter, use the following format:
MODE (TEXT|BYTES). Eg:SELECT[TYPE DATA, MODE BYTES]toggles the operation to work with bytes data andSELECT[TYPE DATA, MODE TEXT]configures the operation to work with text data.
-
-
NOTE: By default, the
TYPEparameter is set tofileand theMODEis set totextfor data search operation and do not require explicit mentionings. Users must also note that thetextfilemode can only read text files and will raise an error for bytes data. -
Operation specifications examples with different parameters:
SELECT: Select filesDELETE: Delete filesSELECT[TYPE DIR]: Select directoriesSELECT[TYPE DATA, MODE BYTES]: Select file-contents in bytes filemodeDELETE[TYPE FILE]: Delete filesSELECT[TYPE DATA]: Select file-contents in text filemode
-
-
FIELDS:
-
This segment is only limited to search operations and defines the metadata fields related to the searched files, data, or directories which are to be displayed in the output search dataframe.
-
For a deeper insight into the available metdata fields for different search query types, please refer to the Query-Fields guide.
-
-
ABSOLUTE or RELATIVE:
- This segment is optional and specifies whether to include the absolute path of the files and directories if the specified path is relative.
-
FILE PATH or DIRECTORY PATH:
-
Defines the path to the file or directory to operate upon. The path can be either absolute or relative as desired and can be specified directly without any other specifications.
-
Note: Paths comprising whitespaces must be enclosed within single quotes
'or double quotes". -
Example:
./src,/usr/local/binand"C:/Program Files/Common Files"
-
-
WHERE CONDITIONS:
-
This segment is optional and is used for filtering search and delete records based on the specified conditions.
-
For a deeper insight into query conditions, please refer to the Query-Conditions guide.
-
To explore more advanced features, refer to the following guides for detailed insights into each topic:
- Query Fields: Dive deep and know about the different metadata fields which can be used with different query operations.
- Query Operations: Explore the various query operations available in FiSE.
- Query Conditions: Discover the ways to write precise and efficient conditions for filtering search and delete records.