The MongoDB Go Driver is the official MongoDB driver for Go applications, providing connectivity to MongoDB databases. It implements the MongoDB wire protocol, handles BSON encoding/decoding, manages connection pooling and server discovery, and supports all MongoDB features including transactions, change streams, GridFS, and encryption. The driver follows a layered architecture with high-level (mongo package), middle-layer (driver implementation), and low-level (BSON handling) components. It uses idiomatic Go patterns including context-based cancellation, functional options for configuration, and dependency injection for pluggable components like authenticators and loggers.
Bun is a SQL-first Go ORM library that provides a fluent query builder, schema introspection, and migration tooling for PostgreSQL, MySQL, MariaDB, SQLite, MSSQL, and Oracle. It wraps the standard database/sql interface and offers a rich set of features including model-based CRUD with struct tags, relation loading (belongs-to, has-one, has-many, many-to-many), soft deletes, CTEs, upserts, and bulk operations. The library is designed for production use with built-in support for OpenTelemetry, structured logging, and New Relic instrumentation via optional extension packages. Architecturally, Bun separates SQL generation into dialect-specific packages (pgdialect, mysqldialect, etc.) and provides its own PostgreSQL wire protocol driver (pgdriver) for low-latency connections. The core query builders (SelectQuery, InsertQuery, etc.) compose reusable query parts (WHERE, ORDER, RETURNING) and use a feature flag bitmask to conditionally emit dialect-specific SQL. The migration system supports both SQL-file migrations and automatic schema diffing, comparing model definitions against live database catalogs to generate ALTER TABLE statements. Key entry points include the DB type (NewDB, NewSelect, etc.), the schema package for table/field metadata, and the migrate package for versioned migrations. The library is extensively tested across multiple database backends using Docker containers and snapshot-based golden file testing. While the codebase is large and dialect-specific branches add complexity, the overall architecture is clean, well-factored, and follows Go idioms consistently.
go-mysql is a pure-Go library for the MySQL and MariaDB ecosystem. Rather than a single application, it exposes a layered set of packages and command-line tools: a low-level packet/protocol layer, a full client connection library, a MySQL-compatible server framework, a binlog replication parser and syncer, a higher-level change-data-capture (CDC) engine called canal, a mysqldump wrapper, and a database/sql driver. The command binaries (`go-mysqlbinlog`, `go-mysqldump`, `go-canal`, `go-mysqlserver`, `go-binlogparser`) demonstrate concrete uses of the library, but the real product is the reusable code surface. The core data flow for replication is: the `replication.BinlogSyncer` connects as a MySQL replica, registers for binlog dump, receives raw binlog frames, and parses them into typed events (`RowsEvent`, `TableMapEvent`, `GTIDEvent`, `QueryEvent`, etc.). The `canal` package layers on top of this by first taking a snapshot through `dump.Dumper` and then streaming subsequent binlog events through a handler interface, making it suitable for feeding downstream stores like Elasticsearch or Redis. The `client` and `server` packages implement the query side of the protocol, including authentication, prepared statements, streaming result sets, TLS, compression, and connection pooling. The `driver` package adapts this to Go's standard `database/sql` interface. The codebase is mature and heavily tested, with CI matrices covering MySQL 8.0/8.4/9.7 and MariaDB 10.11/11.4/11.8, plus fuzz test corpora for GTID and binlog decoding. It also contains notable compatibility engineering: hand-written decoders for MySQL binary JSON, decimal, `datetime2`, `time2`, GTID sets, and row events, all validated against live-server behavior. The main risks are protocol drift and manual maintenance: the error-code mapping ends around MySQL 1863, some binary resultset helpers are deprecated or inconsistent, and much of the value depends on keeping pace with new MySQL/MariaDB binlog event formats. Overall, this is a high-quality, industrially relevant library with strong reuse potential for anyone building MySQL tooling, CDC pipelines, or protocol-compatible servers in Go.
This repository is a Go library that implements a database/sql driver for SQLite3, using cgo to bind to the SQLite C library (either the bundled amalgamation or a system-installed libsqlite3). It provides a full-featured driver supporting transactions, prepared statements, custom functions, aggregators, collations, hooks, virtual tables, backup, serialization, and many SQLite extensions via build tags. The architecture is a single-package driver with a large cgo file (sqlite3.go) and numerous optional feature files selected by build constraints. Key entry points are the SQLiteDriver, SQLiteConn, SQLiteStmt, and SQLiteRows types, which implement the standard database/sql interfaces. The codebase is mature, widely used, and actively maintained, with extensive tests and CI across platforms. It is not a standalone application but a reusable library consumed by Go programs.
This is a Rust library providing an async client for InfluxDB 1.x and 2.x (compatibility mode). It supports writing and reading data via the InfluxDB HTTP API, with a fluent query builder for constructing line protocol write queries and read queries. The library offers optional serde integration for deserializing query results into Rust structs using a custom Serde deserializer that handles InfluxDB's column/value array format. It also includes a derive macro (`InfluxDbWriteable`) for automatically generating write queries from structs. The architecture is centred around a `Client` struct that wraps a `reqwest` HTTP client, with support for authentication (basic auth and token-based) and multiple HTTP backends via feature flags. The codebase is well-structured, with clean separation of concerns, extensive unit and integration tests, and a strong emphasis on correct line protocol escaping. The custom serde deserializer is a notable highlight, demonstrating advanced Serde patterns for transforming array-of-arrays into map-like structures. The project is actively maintained with recent commits and a clear release process.
porsager/postgres is a PostgreSQL client library for Node.js, Deno, and Cloudflare Workers. It provides a full-featured, performant interface to PostgreSQL using tagged template literals for safe, parameterized queries. The library implements the PostgreSQL wire protocol from scratch with zero runtime dependencies, supporting advanced features like connection pooling, prepared statements, cursors, COPY streams, logical replication, large objects, and custom type mapping. The architecture is a factory function that returns a `sql` tagged template function, which lazily connects to the database and pipelines queries over persistent connections. The codebase is well-structured across `src/` with separate modules for connection management, query execution, protocol message building, type serialization/parsing, and error handling. It also includes transpiled builds for CommonJS, Deno, and Cloudflare Workers, each with platform-specific polyfills. The library is actively maintained, has extensive test coverage, and is published under a public domain license.
This repository is neo4rs, a production-grade asynchronous Rust driver for the Neo4j graph database. It implements the Bolt binary protocol (versions 4.x with partial 5.x support) and provides a complete client library for querying, transaction management, connection pooling, cluster routing, and serialization of Neo4j's rich data types (nodes, relationships, paths, temporal and spatial values). The architecture is modular: a connection layer handles TCP/TLS handshakes and chunked message framing; a PackStream serializer/deserializer converts between Rust types and the Bolt wire format; a routing module manages cluster membership and load balancing; and a high-level API (Graph, Session, Txn, RowStream) offers async query execution with automatic retry on transient errors. The codebase includes two parallel Bolt protocol implementations—a legacy one and a newer feature-gated version—which introduces maintenance overhead. Despite this, the project is actively maintained with extensive integration tests against multiple Neo4j versions and a robust CI pipeline. The library is suitable for any Rust application that needs to interact with Neo4j, offering both a high-level ergonomic API and low-level control over the protocol.