Skip to content

feat: enhance builder and count queries#324

Merged
cofin merged 3 commits intomainfrom
feat/total-parms
Jan 16, 2026
Merged

feat: enhance builder and count queries#324
cofin merged 3 commits intomainfrom
feat/total-parms

Conversation

@cofin
Copy link
Member

@cofin cofin commented Jan 16, 2026

Bug Fixes

  • sqlspec/driver/_common.py: Fixed _create_count_query() to pass **original_sql.named_parameters in both return statements (lines ~1488, 1494)

New Window Function Features

  • sqlspec/builder/_factory.py:
    • Added count_over(), sum_over(), avg_over(), max_over(), min_over() methods
    • Added count_over_, sum_over_, avg_over_, max_over_, min_over_ properties
    • Added lag() and lead() methods with full parameter support (column, offset, default, partition_by, order_by)

Driver Enhancements

  • sqlspec/driver/_async.py & _sync.py:
    • Added count_with_window: bool = False parameter to select_with_total()
    • Added _add_count_over_column() helper method for window function pagination

DDL Completeness

  • sqlspec/builder/_ddl.py: Added DropMaterializedView class
  • sqlspec/builder/_factory.py: Added drop_materialized_view() method

@cofin cofin merged commit 344074a into main Jan 16, 2026
15 checks passed
@cofin cofin deleted the feat/total-parms branch January 16, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant