📄️ Data Objects Overview
The data objects section provides an overview of the data structures used in the Hugr query engine. Data objects are the building blocks of database data sources, representing tables and views. They enable processing of tabular data through filtering, aggregation, joins, and mutations via a unified GraphQL API.
📄️ Tables
Tables are the primary data objects in Hugr, corresponding to physical tables in the underlying database. They support full CRUD operations through the generated GraphQL API.
📄️ Views
Views are virtual tables based on SQL queries. They provide a way to simplify complex queries, create derived datasets, or provide different perspectives on your data.
📄️ Queries
Hugr automatically generates various query types for each data object (table or view). These queries provide comprehensive data access patterns without manual implementation.
📄️ Mutations
Hugr automatically generates mutation operations for tables (not views). These mutations handle data modifications with support for relationships, transactions, and returning affected data.
📄️ Aggregations
Hugr provides powerful aggregation capabilities for data analysis, including single-row aggregations and bucket (group-by) aggregations. These are automatically generated for all data objects.
📄️ Relations and Foreign Keys
Hugr supports defining relationships between data objects using foreign key constraints. These relationships enable filtering by related data, subqueries, and cascading operations without requiring database-level foreign keys.
📄️ Joins and Spatial Joins
Beyond foreign key relationships, Hugr provides flexible join capabilities including custom joins, query-time joins, and spatial joins for geographic data.
📄️ Function Calls
Hugr allows you to extend data objects with function call fields, enabling dynamic computations, external API calls, and custom business logic directly within your GraphQL queries.
📄️ Special Table Types
Hugr provides special table type annotations for optimized handling of specific data patterns like OLAP cubes and time-series data.
📄️ Field Transformations and Additional Fields
Hugr automatically adds arguments and calculated fields to certain data types, enabling powerful data transformations and calculations directly in GraphQL queries.