mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
Avoid allocation.
This commit is contained in:
@@ -23,8 +23,9 @@ func stringOrTime(text string) driver.Value {
|
||||
}
|
||||
|
||||
// Slow path.
|
||||
var buf [len(time.RFC3339Nano)]byte
|
||||
date, err := time.Parse(time.RFC3339Nano, text)
|
||||
if err == nil && date.Format(time.RFC3339Nano) == text {
|
||||
if err == nil && text == string(date.AppendFormat(buf[:0], time.RFC3339Nano)) {
|
||||
return date
|
||||
}
|
||||
return text
|
||||
|
||||
@@ -67,7 +67,7 @@ func Fuzz_stringOrTime_2(f *testing.F) {
|
||||
if !v.Equal(date) {
|
||||
t.Fatalf("did not round-trip: %v", date)
|
||||
}
|
||||
// Make with the same zone offset:
|
||||
// With the same zone offset:
|
||||
_, off1 := v.Zone()
|
||||
_, off2 := date.Zone()
|
||||
if off1 != off2 {
|
||||
|
||||
@@ -23,7 +23,7 @@ https://sqlite.org/lang_aggfunc.html
|
||||
- [x] `COVAR_SAMP(dependent, independent)`
|
||||
- [x] `CORR(dependent, independent)`
|
||||
|
||||
## Linear regression
|
||||
## Linear regression aggregates
|
||||
|
||||
- [X] `REGR_AVGX(dependent, independent)`
|
||||
- [X] `REGR_AVGY(dependent, independent)`
|
||||
@@ -35,11 +35,13 @@ https://sqlite.org/lang_aggfunc.html
|
||||
- [X] `REGR_INTERCEPT(dependent, independent)`
|
||||
- [X] `REGR_R2(dependent, independent)`
|
||||
|
||||
## Ordered set aggregates
|
||||
## Set aggregates
|
||||
|
||||
- [ ] `CUME_DIST(value_list) WITHIN GROUP (ORDER BY sort_list)`
|
||||
- [ ] `RANK(value_list) WITHIN GROUP (ORDER BY sort_list)`
|
||||
- [ ] `DENSE_RANK(value_list) WITHIN GROUP (ORDER BY sort_list)`
|
||||
- [ ] `PERCENT_RANK(value_list) WITHIN GROUP (ORDER BY sort_list)`
|
||||
- [ ] `PERCENTILE_CONT(percentile) WITHIN GROUP (ORDER BY sort_list)`
|
||||
- [ ] `PERCENTILE_DISC(percentile) WITHIN GROUP (ORDER BY sort_list)`
|
||||
- [X] `CUME_DIST() OVER window`
|
||||
- [X] `RANK() OVER window`
|
||||
- [X] `DENSE_RANK() OVER window`
|
||||
- [X] `PERCENT_RANK() OVER window`
|
||||
- [ ] `PERCENTILE_CONT(percentile) OVER window`
|
||||
- [ ] `PERCENTILE_DISC(percentile) OVER window`
|
||||
|
||||
https://sqlite.org/windowfunctions.html#builtins
|
||||
Reference in New Issue
Block a user