However I am unsure how to proceed as I have also heard that you do not want to expose your database structure to others.
You don't want to expose them because if SQL injection exists they know which tables to target. However, if SQL inject exists to make this happen it is a moot protection since your security is already broken. Especially since most PHP/SQL applications in the wild rarely set up proper SQL user permissions. So most times the attacker can make a dump of your structure and have no need to guess at it.
The only thing I'm sure of is that the script with the connection username/password should not be hosted on the source repository of my choice.
A lot of projects get around this by providing a sample configuration and then through their version control software create a rule that prevents their configuration from being pushed to the version control repository. An example of this is they may have an example config called config-EXAMPLE.php and their setup script renames this to config.php (or creates from scratch) as soon as the information for it is available. And if they are using Github for example include a .gitignore rule to block config.php which will ensure they don't accidentally expose their own configuration.
It is currently not open source, but I am considering making it open source, so that others can fix bugs, improve it...
Don't forget security when making this statement. The best thing about open source is others can spot what you don't and fix or improve on it. And this includes security. Open sourcing your project could potentially fix more security issues than it exposes.