Sodapop accesses databases through wrappers that provide a consistent interface to PHP's various database libraries. It uses subclasses of Sodapop_Database_Abstract, of which Sodapop_Database_Pdo is the first implementation.
Sodapop manages its connections through the Application object.
Sodapop supports both executing arbitrary SQL strings, as well as prepared statements. If the particular underlying PHP driver doesn't support prepared statements, the syntax will still work; Sodapop will simply convert the query into a regular SQL string. Results are always arrays of associative arrays.
Sodapop similarly supports updating the database via building SQL strings and prepared statements. If the particular underlying PHP driver doesn't support prepared statements, the syntax will still work; Sodapop will simply convert the query into a regular SQL string. The methods don't have return values but can throw exceptions on error.
Sodapop (usually) has a default database connection that is specified in the sodapop.json file. It is also possible to make other connections as needed if an application needs to utilize multiple databases.
Please note: The code below is not necessary for the database connection specified in sodapop.json. The framework connects to that database automatically.
At this time Sodapop supports MySQL through the PHP PDO driver.
If necessary, it is straightforward to add support for new databases and database drivers; there are 7 primary abstract methods in Sodapop_Database_Abstract that need to be written. The source code for /Sodapop/Database/Pdo.php provides a great starting point for anyone looking to add support for a new database.