MCPcopy
hub / github.com/ent/ent / Window

Function Window

dialect/sql/builder.go:2798–2800  ·  view source on GitHub ↗

Window returns a new window clause with a custom selector allowing for custom window functions. Window(func(b *Builder) { b.WriteString(Sum(posts.C("duration"))) }).PartitionBy("author_id").OrderBy("id"), "duration").

(fn func(*Builder))

Source from the content-addressed store, hash-verified

2796// b.WriteString(Sum(posts.C("duration")))
2797// }).PartitionBy("author_id").OrderBy("id"), "duration").
2798func Window(fn func(*Builder)) *WindowBuilder {
2799 return &WindowBuilder{fn: fn}
2800}
2801
2802// PartitionBy indicates to divide the query rows into groups by the given columns.
2803// Note that, standard SQL spec allows partition only by columns, and in order to

Callers 2

RowNumberFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…