@@ -475,20 +475,25 @@ Connection Objects
475
475
476
476
.. method :: create_window_function(name, num_params, aggregate_class, /)
477
477
478
- Creates a user-defined aggregate window function. Aggregate window
479
- functions are supported by SQLite 3.25.0 and higher.
480
- :exc: `NotSupportedError ` will be raised if used with older
481
- versions.
482
-
483
- The aggregate class must implement ``step `` and ``inverse ``
484
- methods, which accept the number of parameters *num_params * (if
485
- *num_params * is -1, the function may take any number of arguments),
486
- and ``finalize `` and ``value `` methods which return the final and
487
- the current result of the aggregate.
488
-
489
- The ``finalize `` and ``value `` methods can return any of the types
490
- supported by SQLite: :class: `bytes `, :class: `str `, :class: `int `,
491
- :class: `float ` and :const: `None `.
478
+ Creates user-defined aggregate window function *name *.
479
+
480
+ *aggregate_class * must implement the following methods:
481
+
482
+ * ``step ``: adds a row to the current window
483
+ * ``value ``: returns the current value of the aggregate
484
+ * ``inverse ``: removes a row from the current window
485
+ * ``finalize ``: returns the final value of the aggregate
486
+
487
+ ``step `` and ``value `` accept *num_params * number of parameters,
488
+ unless *num_params * is ``-1 ``, in which case they may take any number of
489
+ arguments. ``finalize `` and ``value `` can return any of the types
490
+ supported by SQLite:
491
+ :class: `bytes `, :class: `str `, :class: `int `, :class: `float `, and
492
+ :const: `None `. Call :meth: `create_window_function ` with
493
+ *aggregate_class * set to :const: `None ` to clear window function *name *.
494
+
495
+ Aggregate window functions are supported by SQLite 3.25.0 and higher.
496
+ :exc: `NotSupportedError ` will be raised if used with older versions.
492
497
493
498
.. versionadded :: 3.11
494
499
0 commit comments