26. ATTACH TAGS, DETACH TAGS, and GET TAGS#
26.1. Synopsis#
ATTACH TAGS '<tag>' [, ... ] TO <entry_expression> [, ... ]
DETACH TAGS '<tag>' [, ... ] FROM <entry_expression> [, ... ]
GET TAGS FROM <entry_expression> [, ... ]
entry_expression ::= <entry_name> | <find_expression>
26.2. Description#
Use these commands to manage the tags of tables and key/value entries. These commands are available in QuasarDB 3.14.2 and later.
A tag must contain at least one character. A tag can contain a maximum of 1024
characters. Do not use a tag that starts with ... QuasarDB reserves these
names for internal use.
You can specify one or more entry names. You can also use FIND to select
entries. For more information, refer to
key/value lookups.
26.3. ATTACH TAGS#
ATTACH TAGS adds one or more tags to the selected entries.
Attach one tag to a table:
ATTACH TAGS 'production' TO measurements
Attach two tags to multiple entries:
ATTACH TAGS 'production', 'chicago'
TO measurements, FIND(PREFIX='sensor/')
26.4. DETACH TAGS#
DETACH TAGS removes one or more tags from the selected entries.
Detach one tag from a table:
DETACH TAGS 'staging' FROM measurements
Detach tags from entries selected by FIND:
DETACH TAGS 'temporary', 'staging'
FROM FIND(PREFIX='sensor/')
26.5. GET TAGS#
GET TAGS returns the tags that are attached to each selected entry. The
result contains one column for each entry. Each row contains one tag. QuasarDB
uses NULL to align columns that contain different numbers of tags.
Get the tags of one table:
GET TAGS FROM measurements
Get the tags of tables and key/value entries:
GET TAGS FROM measurements, FIND(PREFIX='sensor/')