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 creating indexes on expressions and using function as default #199

Merged
merged 6 commits into from
Feb 2, 2022

Conversation

yuku
Copy link
Contributor

@yuku yuku commented Jan 31, 2022

  • 1668c76 Support creating indexes on expressions:

    create table test (col jsonb);
    create unique index uniq on test (jsonb_extract_path_text(col, 'foo', 'bar'));
    --                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    • The high priority thing described in this comment.
    • If func_name(col_name, 'param1') is given as index, Postgres internally stores it as func_name(col_name, VARIADIC ARRAY['param1'::text]). So this PR also adds simple array constructor syntax support to psqldef. 964d995
  • 8f21a05 Support using function as default:

    create table test (id uuid default generate_uuid_v4());
    --                                 ^^^^^^^^^^^^^^^^^^
  • 2fd5f9d Enable to drop index form tables in non-public table.

    • I found the bug while writing a test case for other changes.

Chore

  • Added publicAndNonPublicSchemaTestCases variable to postgres_test.go
    • It makes us easy to write same test case for both public and non-public schemas.

@yuku yuku marked this pull request as ready for review January 31, 2022 06:43
@yuku
Copy link
Contributor Author

yuku commented Feb 1, 2022

Let me add a bug fix commit 🙇

In master, create view non_public.foo ... always cause create or replace view public.foo ....
38b6f1c fixes the issue.

Copy link
Collaborator

@k0kubun k0kubun left a comment

Choose a reason for hiding this comment

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

Thanks!

@k0kubun k0kubun merged commit 2baa428 into sqldef:master Feb 2, 2022
@yuku yuku deleted the expression-index branch February 2, 2022 05:37
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.

2 participants