Code Snippets

Category: Database

SQLite with the sqlite3 Stdlib

Create a table, insert rows, and query with parameterized SQL.

Author: chris

PDO MySQL Connection in PHP

Connect to MySQL with PDO and run a prepared SELECT.

Author: chris

Connect to PostgreSQL in Go

Open a database/sql handle to Postgres and query rows.

Author: chris

ActiveRecord Query Snippet

Define a model and run a chained where/order query with ActiveRecord.

Author: chris

Connect to MySQL with DBI

Open a DBI handle to MySQL, run a SELECT, and iterate rows.

Author: chris