Open isosphere opened 2 years ago
I see what you are saying, what kind of API would you expect for this?
I would probably give you a better answer if I were more experienced with Rust, but I will try and muddle through.
I have reviewed your database implementations under /src/db/
- if I could make my own implementation for a database, I would be happy to replicate all of the code you've used for each database type to achieve my goal of custom schema.
It would have the added benefit of allowing others to extend your crate to support new data storage types as per their needs.
I am not sure how this can be accomplished, though. We would need to be able to implement our own open_...
functions for Users
that would use our custom DBConnection
implementations. I think it might be sufficient to make the involved declarations pub
, but there may be a much better best practice than that.
I think it may not be so simple, since the User struct depends very strongly on the schema. I do have planned adding more functionality to the User struct, which is one of the reasons I've tried to keep them private.
But I do agree with you that this is a need that should be addressed, I just don't know how at the moment.
It looks like if I would like to use a different SQL schema than this project has built into it I would have to do it in a fork.
Since
rocket_auth::db
is private I cannot begin to make my ownDBConnection
implementation that used my own queries.I'll probably cave and let your schema win, but this will make it difficult for people to integrate this authentication with existing systems.