Connect to your Heroku DB easily.
Made with .Net 6
-> Changelog
- connect to Heroku DB using:
- environment variable
DATABASE_URL
(default) - manually passed Url
- environment variable
Configuration
Add Nuget package from here.
public void ConfigureServices(IServiceCollection services) {
services.AddDbContext<ApplicationDbContext>(options => options.UseNpgsql(new HerokuDbConnector().Build()));
}
var connector = new HerokuDbConnector();
Console.WriteLine(connector.Build());
// Output: Host=ab1-11-123-12-123.eu-west-1.compute.amazonaws.com;Port=1234;Username=aaaaaaaaaaaaaa;Password=000000000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;Database=aaaaaaaaaaaaaa;SSL Mode=Require;Trust Server Certificate=True
I am happy to accept suggestions for further development. Please feel free to add Issues :)
This project is licensed under the MIT License - see the LICENSE file for details.