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

Allow custom extensions to use options #683

Closed

Conversation

greg-rychlewski
Copy link
Member

@greg-rychlewski greg-rychlewski commented Jun 28, 2024

Currently the extensions users create themselves cannot access the options passed to the type module. A few of the options, like :null and :decode_binary seem like they should be passed to them. For example, we previously asked users to define their own ltree and lquery extensions and our own implementations are using the :decode_binary option. Also, our own documented example of a custom extension is passed the opts https://hexdocs.pm/postgrex/Postgrex.Extension.html

@greg-rychlewski
Copy link
Member Author

greg-rychlewski commented Jun 28, 2024

I had a misunderstanding. We ask the user to pass a tuple if they want opts:

Postgrex.Types.define(MyApp.Types, [{MyApp.LTree, [decode_copy: :copy]}])

Closing this

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.

1 participant