IQUEST(1)

πŸ“¦ version 5.0.2, in nixos 26.05

πŸ’… IQUEST(1) β€” an iRODS iCommand

okay bestie, so iquest is one of the iRODS iCommands, and she's basically the main character of "asking the ICAT questions." This page is filed under User Commands in the iRODS 5.0.2 manual, and we're gonna get you fluent, no cap. ✨


🌸 SYNOPSIS

iquest [-hz] [--no-page] [[hint] format_string] <query_string>
iquest --sql <predefined_sql_string> [format_string] [arguments]
iquest attrs

Three whole moods, bestie. Pick your fighter. 🫢


✨ OPTIONS ✨

  • format_string β€” a C-style format string, restricted to character strings (so like, the pretty printing part β€” keep it stringy, okay?).
  • query_string β€” the selection query string. The section Selection query syntax below has all the lore on how to write it.
  • -z zone_name β€” the zone you wanna query. If you leave it out or put in something invalid, it just defaults to your local zone. Lowkey forgiving. πŸ™ˆ
  • --no-page β€” by default, once you've printed a large number of results (256), it stops and asks if you wanna keep going. This flag says "nope, I'm built different, keep it coming" and skips that prompt entirely.
  • --sql β€” run a pre-defined SQL query instead. The query you name has to match one your admin already defined (they do it with iadmin h asq, which is short for "add specific query" β€” yes, the abbreviation ate πŸ’…). Your site might have a few of these set up. There's a special alias ls (as in --sql ls) that's normally defined to show you all of them. You can refer to a query by its full SQL or by its alias, if one's defined. But real talk: generally it's better to use the general-query (the non---sql forms on this page) because that one generates the proper SQL for you β€” it knows how to link the ICAT tables, handles access control, and deals with all the other security aspects. Iconic behaviour, honestly. If your SQL takes arguments, you enter them right after the SQL. And just like without --sql, you can give a printf format statement to format the results β€” except when you're using aliases.
  • -h β€” display the help and exit. Short king. πŸ‘‘
Heads up: if no-distinct appears before the query_string, the normal distinct option on the SQL gets bypassed. This is useful in rare cases only, so like… don't make it your whole personality. πŸ’€

Wanna do a case-insensitive search? Pass the uppercase option (or upper, same vibe) and make ALL your conditional input values uppercase. Like this fr:

iquest uppercase "SELECT DATA_ID WHERE COLL_NAME LIKE '%/TEST'
AND DATA_NAME = 'FOO.BIN'"
⚠️ Case-insensitive search requires that all the columns in the WHERE-clause have a string-based data type (varchar, etc.). That means columns like DATA_SIZE will make the query fail with a CAT_SQL_ERR. Not me crying at the terminal 😭 β€” just keep it stringy!

πŸ¦‹ Selection query syntax

(This is the tea for the query_string argument, bestie.)

SELECT <attribute> [, <attribute>]* [WHERE <condition> [AND <condition>]*]
  • attribute β€” the name of an attribute, from iquest attrs.
  • condition β€” a conditional statement. Peep the Conditional statement syntax section below.

You can also use a few aggregation operators β€” think SUM, COUNT, MIN, MAX, and AVG β€” or ORDER and ORDER_DESC (that's descending) if you need to specify an order. Slay. ✨


πŸŽ€ Conditional statement syntax

(This is what goes inside the WHERE conditionals in your selection queries.)

<attribute> <rel-op> <value>
  • attribute β€” the name of an attribute, from iquest attrs.
  • rel-op β€” a relational operator, like =, <>, >, <, LIKE, NOT LIKE, BETWEEN, etc.
  • value β€” either a constant or a wild-carded expression. Use % and _ as wildcards, and use \ to escape them. 🧚

See https://docs.irods.org/5.0.2/system_overview/genquery/#example-queries for examples.


and that's the whole page, bestie β€” go query something iconic πŸ’œ

β€” sign-off: this little love letter comes from the iquest page of iRODS-5.0.2, dated January 1980 (yes, really, the date said 1980 β€” vintage era, periodt). πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from