Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Why is the connection type having binary as the third element of its tuple? #89

Open
dimitarvp opened this issue Aug 5, 2019 · 2 comments

Comments

@dimitarvp
Copy link
Contributor

When I am working with Sqlitex and opening connections, I always get a tri-tuple like the following:

{
  :connection,
  #Reference<0.1196713639.350486530.23370>,
  #Reference<0.1196713639.350617602.23368>
}

IMO the type should not be:

@type connection :: {:connection, reference, binary()}

but instead it should be:

@type connection :: {:connection, reference(), reference()}

Am I missing something obvious?

@ConnorRigby
Copy link
Member

You are correct. Or welcome or I will take care of it tomorrow.

In all reality, this type should probably be opaque as the value can only be used to communicate with the NIF interface and should not be deconstructed

@dimitarvp
Copy link
Contributor Author

I thought the same. No need for the type to be introspectable, I just want Dialyzer to not complain in my app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants