SelectStatement represents a SELECT SQL statement with full SQL-99/SQL:2003 support. SelectStatement is the primary query statement type supporting: - CTEs (WITH clause) - DISTINCT and DISTINCT ON (PostgreSQL) - Multiple FROM tables and subqueries - All JOIN types with LATERAL support - WHERE, GROU
| 421 | // - Enhanced LATERAL JOIN support via TableReference.Lateral |
| 422 | // - FILTER clause support via FunctionCall.Filter |
| 423 | type SelectStatement struct { |
| 424 | With *WithClause |
| 425 | Distinct bool |
| 426 | DistinctOnColumns []Expression // PostgreSQL DISTINCT ON (expr, ...) clause |
| 427 | Top *TopClause // SQL Server TOP N [PERCENT] clause |
| 428 | Columns []Expression |
| 429 | From []TableReference |
| 430 | TableName string // Added for pool operations |
| 431 | Joins []JoinClause |
| 432 | PrewhereClause Expression // ClickHouse PREWHERE clause (applied before WHERE, before reading data) |
| 433 | Sample *SampleClause // ClickHouse SAMPLE clause (comes after FROM/FINAL, before PREWHERE) |
| 434 | Where Expression |
| 435 | GroupBy []Expression |
| 436 | Having Expression |
| 437 | Qualify Expression // Snowflake / BigQuery QUALIFY clause (filters after window functions) |
| 438 | // StartWith is the optional seed condition for CONNECT BY (MariaDB 10.2+). |
| 439 | // Example: START WITH parent_id IS NULL |
| 440 | StartWith Expression // MariaDB hierarchical query seed |
| 441 | // ConnectBy holds the hierarchy traversal condition (MariaDB 10.2+). |
| 442 | // Example: CONNECT BY PRIOR id = parent_id |
| 443 | ConnectBy *ConnectByClause // MariaDB hierarchical query |
| 444 | Windows []WindowSpec |
| 445 | OrderBy []OrderByExpression |
| 446 | Limit *int |
| 447 | Offset *int |
| 448 | Fetch *FetchClause // SQL-99 FETCH FIRST/NEXT clause (F861, F862) |
| 449 | For *ForClause // Row-level locking clause (SQL:2003, PostgreSQL, MySQL) |
| 450 | Pos models.Location // Source position of the SELECT keyword (1-based line and column) |
| 451 | } |
| 452 | |
| 453 | // TopClause represents SQL Server's TOP N [PERCENT] clause |
| 454 | // Syntax: SELECT TOP n [PERCENT] columns... |
nothing calls this directly
no outgoing calls
no test coverage detected