Notes¶
Additional Features¶
Replace result returned by
funcsql.fetch()to beIterator[Row] | None(or raise an exception for no rows.) It’s awkward to test an iterator for being empty; it’s much easier to see if the result is anIteratoror aNoneobject. (Perhaps onlyfuncsql.fetch_select()needs to be changed to simplifyfuncsql.fetch_recursive().)Partitioned Tables.
Implement
funcsql.Table.__add__(), andfuncsql.Table.__iadd__()to do SQL union.Implement depth-first recursive query alternative.
Implement union-all recursive query alternative.
Partitioned Tables¶
Partitioned tables should be an extention to funcsql.Table and nothing more.
The use of list() in funcsql.group_reduce() is a potential problem.
Fix
funcsql.Tableto replacelist().Fix
funcsql.group_reduce()to usefuncsql.Tableinstead oflist().Subclass
funcsql.Tableto show how partitioning would work.
Badges¶
Coverage.
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
See https://dev.to/thejaredwilcurt/coverage-badge-with-github-actions-finally-59fa
See https://nedbatchelder.com/blog/202209/making_a_coverage_badge.html
Make Public Gist, get secret, add secret to this repo.
Make Workflows to get coverage and make badge(s).
To Do’s¶
Todo
[LEFT | RIGHT | FULL] OUTER? JOIN
An implicit union of non-matching rows. An additional “filterfalse()`` is required to provide NULL-filled missing rows.
(The original entry is located in /Users/slott/github/local/functional-SQL/docs/../src/funcsql.py:docstring of funcsql.Select.join, line 25.)
Todo
USING("col1", "col2") builds labmda cr: cr.table.col1 == cr.?.col1
Based on left and right sides of join(table, using=("col1", "col2")).
(The original entry is located in /Users/slott/github/local/functional-SQL/docs/../src/funcsql.py:docstring of funcsql.Select.join, line 30.)
Todo
Offer DISTINCT variants to reduce to a set before computation.
(The original entry is located in /Users/slott/github/local/functional-SQL/docs/../src/funcsql.py:docstring of funcsql.Aggregate, line 36.)
Todo
Refactor to return Iterator | None or raise an exception.
It’s awkward to test an Iterator. It’s easier to test the class (None or Iterator) or handle an exception.
(The original entry is located in /Users/slott/github/local/functional-SQL/docs/../src/funcsql.py:docstring of funcsql.fetch, line 37.)
Todo
Outer Joins are implemented here.
(The original entry is located in /Users/slott/github/local/functional-SQL/docs/../src/funcsql.py:docstring of funcsql.where_filter, line 7.)
Todo
Avoid simple list() in order to cope with partitioned tables.
(The original entry is located in /Users/slott/github/local/functional-SQL/docs/../src/funcsql.py:docstring of funcsql.group_reduce, line 16.)