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

sql/postgres: use native pg time types #686

Merged
merged 2 commits into from
Apr 7, 2022
Merged

sql/postgres: use native pg time types #686

merged 2 commits into from
Apr 7, 2022

Conversation

a8m
Copy link
Member

@a8m a8m commented Apr 6, 2022

No description provided.

}

// formatTime overrides the default printing logic done by schemahcl.hclType.
func formatTime() specutil.TypeSpecOption {
Copy link
Member

Choose a reason for hiding this comment

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

Should the driver know about hcl?

Copy link
Member

Choose a reason for hiding this comment

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

This is why I added the Printer prop you removed in this PR @a8m

Copy link
Member Author

Choose a reason for hiding this comment

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

The driver knows nothing about hcl. It's the same schemaspec API that exists today. However, since there is some reflection/parsing logic going on there, I added this comment to make the life easier for future readers.

I don't think the Printer is needed. From its name, I assumed the printer was used for printing, but that's was not the case (print to driver presentation and then call Parse). Instead, I'd add something like WithTypeParser to allow overriding the parsing logic of one typespec if we'll need something like this to avoid one layer of abstraction.

sql/postgres/convert.go Outdated Show resolved Hide resolved
Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>
@a8m a8m merged commit 7ea9876 into master Apr 7, 2022
@a8m a8m deleted the pgprecision branch April 7, 2022 07:11
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.

None yet

3 participants