PetaPoco
PetaPoco copied to clipboard
Methods/properties missing from IDatabase
There appear to be some public methods and properties of Database
which are missing from IDatabase
(and from any of the other interfaces which IDatabase
implements). I wasn't sure if this was intentional or not; I ran into it because IDatabaseBuildConfiguration.Create()
returns an IDatabase
, and I noticed that there were some things I couldn't do.
// These should be accessible from the interface
Connection property
KeepConnectionAlive property
CreateCommand();
// These two should probably be marked protected instead of public.
// They're part of the plumbing -- are there times when a user should call them directly?
OpenSharedConnection()
CloseSharedConnection()
// This one seems like it might be protected or private instead of public,
// otherwise add to interface.
FormatCommand()
// These should probably be protected, since they're only used by Database
// descendants, not called directly.
OnBeginTransaction() and friends
Good eye. We should fix this.
I'm happy to put together a PR if you let me know which way you'd like to go. Note that moving some public methods to protected or private, as I suggest, is a breaking change, even if it might be better design. For that matter, adding methods to an interface is also a breaking change for anyone who has made their own object to implement IDatabase
.
Yeah, true. Ok, then we should bump the version to 6.1
(Under sematic versioning, probably 6.1 should have been when stored procs were added, and 6.2 should be async. A breaking change would mean 7.0.)
Happy to roll version 7