GroupColumn
Represents one GROUP BY column, optionally schema/table-qualified. Select#groupBy() builds
GroupColumn instances internally for every string you pass. Extends
BaseField.
Constructor
GroupColumn(value: string): GroupColumn
new GroupColumn(value: string): GroupColumn
Dual-callable. value must match [[schema.]table.]field — anything else throws a TypeError
("does not match group column format").
import { Select } from '@sqb/builder';
Select('country', 'count(*)').from('customers').groupBy('country');
// ... group by country
Select().from('customers').groupBy('schema1.customers.country');
// ... group by schema1.customers.country
Properties
| Key | Type | Readonly | Description |
|---|---|---|---|
_type | SerializationType.GROUP_COLUMN | Yes | Discriminates this node during serialization. |
_field | string | No | The unqualified column name. |
_table | string | undefined | No | Table qualifier, if present in value. |
_schema | string | undefined | No | Schema qualifier, if present in value. |
Plus everything inherited from BaseField.
Methods
GroupColumn has no chainable methods — it exposes only its serialization logic. Reserved words
in _field are escaped (double-quoted) automatically when serialized.