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

Postgres Default Values #550

Merged
merged 6 commits into from Mar 4, 2020
Merged

Postgres Default Values #550

merged 6 commits into from Mar 4, 2020

Conversation

do4gr
Copy link
Member

@do4gr do4gr commented Mar 4, 2020

test them and ensure that we remove the ::type annotations

Fixes prisma/prisma#1704

@do4gr do4gr added this to the Preview 24 Old milestone Mar 4, 2020
Copy link
Contributor

@tomhoule tomhoule left a comment

Choose a reason for hiding this comment

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

lgtm 👍

// range_tsrange tsrange,
// range_tstzrange tstzrange,
// range_daterange daterange
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I can finish some of these today, I'll send you the PR for review when it's in a mergeable state (it will need quaint changes too).

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, then I'll continue the test with those later on. Most of them are turned into Strings atm anyways, that is why I did not test them.

@@ -205,16 +205,20 @@ impl SqlSchemaDescriber {
};
let tpe = get_column_type(data_type.as_ref(), &full_data_type, arity, enums);

//todo we might want to use regexes here
Copy link
Contributor

Choose a reason for hiding this comment

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

yes we could use a regex, but part of it is variable, so they would have to be compiled for every field or (I think I already did that somewhere in the sql-schema-describer) capture the type, then match for the regex and the type capture, which is probably best for performance but also more complicated.

Copy link
Contributor

Choose a reason for hiding this comment

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

And sql-schema-describer performance is already good enough™

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, then we'll leave it as is for now.

@do4gr do4gr merged commit 56d82f1 into master Mar 4, 2020
@do4gr do4gr deleted the PostgresDefaultValues branch March 4, 2020 12:59
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.

[Introspection] Remove type annotation from Postgres default in cases other than Text
2 participants