Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nullary products #22

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Support nullary products #22

wants to merge 4 commits into from

Conversation

alexfmpe
Copy link
Contributor

Needed this alongside haskell-beam/beam#563

@alexfmpe
Copy link
Contributor Author

alexfmpe commented Feb 2, 2022

This probably needs to be reworked given upstream concerns

Copy link
Contributor

@cgibbard cgibbard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should see about the potential for completely empty tables. I believe tables without columns are allowed in postgresql, and obviously, they're a perfectly cromulent notion, but they may not be permitted in some versions of SQL.

@cgibbard
Copy link
Contributor

cgibbard commented Feb 2, 2022

psql (9.6.15)
Type "help" for help.

postgres=# CREATE TABLE zero ();
CREATE TABLE
postgres=# \d zero
    Table "public.zero"
 Column | Type | Modifiers 
--------+------+-----------

postgres=# insert into zero values ();
ERROR:  syntax error at or near ")"
LINE 1: insert into zero values ();
                                 ^
postgres=# insert into zero default values;
INSERT 0 1
postgres=# SELECT * FROM zero;
--
(1 row)

postgres=# insert into zero default values;
INSERT 0 1
postgres=# SELECT * FROM zero;
--
(2 rows)

@cgibbard
Copy link
Contributor

cgibbard commented Feb 2, 2022

I think this may require a backend-specific check to see if the resulting tables are sensible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants