Skip to content

test: add PostgreSQL integration test against real database #151

@nao1215

Description

@nao1215

Roadmap: #1

Problem

There is no integration test that runs generated pog adapter code against an actual PostgreSQL database. The SQLite integration test (integration_test/sqlite_test.sh) exercises real CRUD operations against an in-memory SQLite database, but no equivalent exists for PostgreSQL.

Evidence

  • integration_test/run.sh only runs sqlite_test.sh and compile_test.sh
  • integration_test/compile_test.sh verifies that pog adapter code compiles, but never runs it
  • test/codegen_test.gleam tests pog adapter code at the string-generation level only

Expected

Create integration_test/postgresql_test.sh that:

  1. Starts or connects to a PostgreSQL instance (e.g., via Docker or CI service)
  2. Generates native pog adapter code from a test schema and queries
  3. Creates a temporary Gleam project with the generated code
  4. Runs CRUD operations against the real database
  5. Verifies correct results (insert, select one, select many, update, delete)
  6. Tests PostgreSQL-specific features (RETURNING clause, ENUM types, UUID)

This can use a CI PostgreSQL service container in GitHub Actions.

Why This Matters

The pog adapter is a significant amount of generated code (~1000 lines) that has never been validated against a real PostgreSQL database. Bugs in query call construction, parameter encoding, or result decoding would go undetected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions