sqlitex icon indicating copy to clipboard operation
sqlitex copied to clipboard

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

Open dimitarvp opened this issue 6 years ago • 2 comments

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?

dimitarvp avatar Aug 05 '19 16:08 dimitarvp

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

ConnorRigby avatar Aug 07 '19 14:08 ConnorRigby

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

dimitarvp avatar Aug 07 '19 14:08 dimitarvp