We recommend two main patterns when working with SQL databases. You can make your database connection directly from within your own code, storing credentials outside of your source using Hosted Data and the Algorithmia Data API. Or, for supported databases like MySQL, PostgreSQL, and MS SQL Server, you can make use of our helper algorithms to automatically store per-user credentials and make queries while keeping database connection code outside of your algorithm.