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

Revamp functions to use DEFAULT values #283

Open
RekGRpth opened this issue Nov 11, 2021 · 11 comments
Open

Revamp functions to use DEFAULT values #283

RekGRpth opened this issue Nov 11, 2021 · 11 comments

Comments

@RekGRpth
Copy link

SELECT has_column('schema'::name, 'table'::name, 'column'::name);

treated as

SELECT has_column('schema'::name, 'table'::name, 'column'::text);
@RekGRpth
Copy link
Author

but

SELECT col_not_null('schema'::name, 'table'::name, 'column'::name);

treated right!

@RekGRpth
Copy link
Author

also col_has_default has same bug

@RekGRpth
Copy link
Author

also col_hasnt_default has same bug

@RekGRpth
Copy link
Author

also col_default_is has same bug

@RekGRpth
Copy link
Author

also has_pk has same bug

@RekGRpth
Copy link
Author

also hasnt_pk has same bug

@RekGRpth
Copy link
Author

also col_is_pk has same bug

@RekGRpth
Copy link
Author

also col_isnt_pk has same bug

@RekGRpth
Copy link
Author

also has_unique has same bug

@RekGRpth
Copy link
Author

also col_is_unique has same bug

@theory
Copy link
Owner

theory commented Nov 14, 2021

col_not_null()'s use of description TEXT DEFAULT NULL as the last argument might be the reason it works better. Now that we've dropped support for v9.0 and earlier, it might make sense to refactor many of the older functions to use that syntax, as it simplifies the code and might well address resolution issues such as @RekGRpth mentions here. Lotta work, though, and not gonna happen before we ship 1.2.0, but I would certainly welcome a PR making such a change.

@theory theory changed the title has_column bug Revamp functions to use DEFAULT values Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants