$ show datacharmer/test_db
This repository is a distribution of the classic 'employees' sample database, a realistic relational dataset of ~300,000 employees, ~2.8 million salary records, and associated department/title/manager data. It is not an application but a data asset and benchmark fixture used to test database servers, application integrations, and migration tooling. The repo contains MySQL and PostgreSQL schemas, raw data dumps, partitioned table variants, stored procedures/views, and an integrated integrity-test suite that verifies row counts and incremental MD5/SHA-1/SHA-256 checksums. It also bundles a version of the Sakila sample database. CI workflows exercise loading and integrity checks across MySQL 5.6-9.6, Percona Server, MariaDB, and PostgreSQL 16/17, and the SHA-256 checksums are intentionally identical across all supported engines. The primary value is a non-trivial, self-contained dataset with strong cross-database compatibility and a clever, reusable data-integrity verification pattern.
The LLM identified 4 files worth highlighting for reuse:
Computes a rolling SHA-256 checksum over each table's rows in primary-key order using MySQL user variables (@crc := SHA2(CONCAT_WS('#', @crc, ...), 256)), then compares against expected values. This is a reusable data-integrity pattern for verifying that a dataset loaded into any SQL database matches a canonical source, catching row-level corruption, missing rows, or ordering issues. The technique is portable to other table sets with minimal adaptation.
Reimplements the MySQL incremental hash technique as a PL/pgSQL function compute_table_sha256(p_query TEXT) that iterates over rows returned by a query and produces the same SHA-256 checksum as MySQL's SHA2(CONCAT_WS(...)) approach. Demonstrates how to port a MySQL-specific integrity pattern to PostgreSQL and can be adapted to verify any table by passing a query that returns a single row_text column.
Loads the MySQL-style INSERT dumps into PostgreSQL by stripping backticks with sed and piping to psql. Parameterized via the PSQL environment variable, drops/recreates the schema for idempotency, and is a clean, minimal example of adapting MySQL dump files for PostgreSQL ingestion. Useful as a template for any MySQL-to-PostgreSQL data migration.
Creates the employees schema with range COLUMNS partitioning on date columns for the titles and salaries tables, using version-gated executable comments (/*!50510 ... */) so it works on MySQL 5.5+. A useful template for partitioning large temporal tables by date range while preserving compatibility with older MySQL versions.