Notes

Additional Features

  1. Replace result returned by funcsql.fetch() to be Iterator[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 an Iterator or a None object. (Perhaps only funcsql.fetch_select() needs to be changed to simplify funcsql.fetch_recursive().)

  2. Partitioned Tables.

  3. Implement funcsql.Table.__add__(), and funcsql.Table.__iadd__() to do SQL union.

  4. Implement depth-first recursive query alternative.

  5. 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.

  1. Fix funcsql.Table to replace list().

  2. Fix funcsql.group_reduce() to use funcsql.Table instead of list().

  3. Subclass funcsql.Table to 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

  1. Make Public Gist, get secret, add secret to this repo.

  2. 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.)