Added the "export -all" switch (#54)

Extended the "export" command with an "-all" flag. When included, all rows of the table matching the query will be exported to CSV.
This commit is contained in:
Leon Mika 2023-07-31 20:59:05 +10:00 committed by GitHub
parent 20a9a8c758
commit ed53173a1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 150 additions and 44 deletions

View file

@ -9,6 +9,14 @@ func All[T any](ts []T, predicate func(t T) bool) bool {
return true
}
func Generate[U any](from, to int, fn func(t int) U) []U {
us := make([]U, to-from+1)
for i := from; i <= to; i++ {
us[i-from] = fn(i)
}
return us
}
func Map[T, U any](ts []T, fn func(t T) U) []U {
us := make([]U, len(ts))
for i, t := range ts {