thehardwarestore.ai

where AI agents shop for the right tools

── 99246 repos indexed ── | filtered by tag: postgres
PostgREST/postgrest ★ 27693 1229 APPLICATION

PostgREST is a production-grade Haskell web server that converts an existing PostgreSQL schema into a RESTful HTTP API. At startup it introspects PostgreSQL system catalogs to build a schema cache of tables, views, relationships, routines, and media handlers. Each request is parsed into an internal AST (ApiRequest), planned against the schema cache (Plan), compiled to parameterized SQL (QueryBuilder), and executed through the vendored Hasql PostgreSQL driver. The server supports full CRUD, RPC calls, resource embedding via foreign keys, filtering, ordering, pagination, JWT authentication, OpenAPI generation, and custom PostgreSQL-defined media types. Authorization is delegated to the database: PostgREST connects as an authenticator role that does SET ROLE to the JWT-specified role, so row-level security, grants, and triggers are enforced by PostgreSQL. The system runs as a single Haskell binary with lifecycle management, SIGUSR2/config reload through LISTEN/NOTIFY, a separate admin server exposing /live, /ready, /metrics, and schema cache dumps, and metrics via Prometheus. Build and packaging is Nix-based with static linking, Docker images, and cabal/stack support. CI runs integration suites against multiple PostgreSQL versions and includes load, memory, observability, and replica tests. Maintenance is active, with frequent releases and broad production use. The codebase demonstrates a clean separation between HTTP parsing, query planning, SQL generation, and database access. It is one of the few Haskell projects at this scale with deep PostgreSQL binary-protocol integration. The vendored Hasql driver and several standalone modules—media type parsing, HTTP Range handling, SIEVE cache, JSON path parsing—are extractable as reusable components for other Haskell services.

RATING: 9.9/10 MAINT: active DRIFT: low
â–¸ 5 reusable components found
tobymao/sqlglot ★ 9682 1334 APPLICATION

SQLGlot is a pure-Python SQL parser, transpiler, optimizer, lineage analyzer, diff engine, and in-process executor with support for 30+ SQL dialects including Snowflake, BigQuery, DuckDB, Spark, Trino, Postgres, and MySQL. The core pipeline tokenizes SQL source, parses it into a rich expression AST, applies optimizer passes such as column qualification, predicate pushdown, subquery decorrelation, type annotation, and simplification, then generates dialect-specific SQL. It also includes a planner/executor for running queries against Python data structures and a CLI for transpilation and tokenization. Despite the breadth of dialect coverage, the architecture centralizes shared language machinery in base tokenizer/parser/generator classes, with dialects as declarative overrides, and the library has zero required runtime dependencies.

RATING: 9.9/10 MAINT: active DRIFT: low
â–¸ 6 reusable components found
Evokoa/pgGraph ★ 1054 85 APPLICATION

pgGraph is a PostgreSQL extension written in Rust (via pgrx) that adds high-performance graph query capabilities directly into PostgreSQL. It allows users to model graphs by registering existing relational tables as nodes and edges, building a compressed sparse row (CSR) adjacency index for sub-millisecond traversals, shortest paths, and connected components. The extension exposes SQL functions (`graph.traverse`, `graph.shortest_path`, `graph.search`, `graph.gql`, `graph.cypher`) and supports both openCypher and a subset of GQL for querying property graphs. It integrates deeply with PostgreSQL security (row-level security, multi-tenancy, ACLs), provides resource governance (memory, disk, work unit budgets), and includes a durable projection layer with atomic manifests, delta segments, compaction, and crash recovery. The codebase is structured as a pgrx extension with a Rust core, SQL bootstrap scripts, background workers for build/maintenance jobs, and an extensive test suite including fuzz targets, property-based tests, and heavy integration tests for concurrency, crash recovery, and performance gates.

RATING: 9.8/10 MAINT: active DRIFT: low
â–¸ 3 reusable components found
metabase/metabase ★ 49433 6854 APPLICATION

Metabase is an open-source business intelligence platform that enables users to query, visualize, and share data through an intuitive interface. The system is built as a full-stack application with a Clojure backend and React/TypeScript frontend, supporting both self-hosted and cloud deployments. The architecture follows a modular monolith pattern with clear separation between the core application, enterprise features, and embedding SDK components. The codebase demonstrates sophisticated engineering practices including a comprehensive plugin system that allows enterprise features to extend core functionality, a custom query builder with both GUI and SQL interfaces, and a robust embedding SDK for integrating Metabase components into external applications. The frontend utilizes modern React patterns with Redux for state management, while the backend employs Clojure's functional programming strengths for data processing and API handling. Key architectural highlights include the metabase-lib library for query construction and metadata management, a sophisticated visualization system with ECharts integration, and a multi-tenant embedding solution with JWT/SAML authentication. The codebase shows strong attention to internationalization, accessibility, and performance optimization through features like query caching, lazy loading, and bundle splitting.

RATING: 9.6/10 MAINT: active DRIFT: low
â–¸ 5 reusable components found
SeaQL/sea-orm ★ 9913 738 APPLICATION

SeaORM is a production-grade async ORM for Rust, supporting MySQL, PostgreSQL, and SQLite. It provides a rich entity model with derive macros, a fluent query builder, migration framework, code generation from database schemas, and an RBAC authorization layer. The architecture is modular: core ORM crate (sea-orm), derive macros (sea-orm-macros), code generation (sea-orm-codegen), migration framework (sea-orm-migration), synchronous variant (sea-orm-sync), and integrations (sea-orm-rocket). Key patterns include ActiveModel for CRUD, ActiveModelEx for nested mutations, dynamic entities for runtime schemas, and a proxy database trait for custom backends. The codebase is well-tested with integration tests across multiple database backends and includes numerous example applications for web frameworks like Axum, Actix, Rocket, and Loco. The repository is primarily an application library (ORM framework) with no data research components. It is actively maintained with recent releases and a large community. The code demonstrates high craftsmanship with clean abstractions, extensive use of Rust's type system, and careful handling of async/sync duality. However, the duplication between the async and sync variants (sea-orm-sync) introduces maintenance overhead and risk of drift.

RATING: 9.5/10 MAINT: active DRIFT: low
â–¸ 3 reusable components found
ankane/pghero ★ 8935 479 APPLICATION

PgHero is a Ruby gem packaged as a mountable Rails engine (and a standalone Docker image) that provides a web-based performance dashboard for PostgreSQL. In production it connects to one or more databases through dynamically created ActiveRecord subclasses — one connection pool per database — and queries PostgreSQL system catalogs and statistics views (pg_stat_statements, pg_stat_activity, pg_stat_user_indexes, pg_statio_user_tables, pg_stat_progress_vacuum, pg_stat_replication, pg_sequences, and more) to render health checks, space usage and growth, live queries, historical and current query stats, safe EXPLAIN plans, connection breakdowns, maintenance/vacuum state, and server settings. It also integrates with AWS CloudWatch and Google Cloud Monitoring for CPU/IOPS/storage system metrics. Historical query stats are captured by a rake task into pghero_queries/pghero_query_stats tables; the same pattern stores space stats in pghero_space_stats, enabling time-range sliders and per-query history charts.

RATING: 9.5/10 MAINT: active DRIFT: low
â–¸ 4 reusable components found
grafana/grafana ★ 76920 14788 APPLICATION

Grafana is an open-source observability platform for querying, visualizing, and alerting on metrics, logs, and traces. It is a full-stack application with a Go backend and React/TypeScript frontend, featuring a plugin system for datasources, panels, and apps. The architecture is a monolith with Kubernetes-style API extensions, supporting multiple database backends (MySQL, PostgreSQL, SQLite). It includes built-in alerting, dashboard management, provisioning, and RBAC. The codebase is large and well-maintained, with high-quality UI components and data abstractions, but has some technical debt from dual build systems and generated code.

RATING: 9.4/10 MAINT: active DRIFT: medium
â–¸ 5 reusable components found
lib/pq ★ 9962 972 APPLICATION

pq is a pure Go PostgreSQL driver for the database/sql interface. It implements the full PostgreSQL wire protocol, supporting SSL/TLS, SCRAM-SHA-256, MD5, and GSSAPI/Kerberos authentication, as well as advanced features like LISTEN/NOTIFY, COPY, array scanning, and multihost connections. The library is designed for production use, with a comprehensive test suite that includes both mocked and live PostgreSQL environments (Docker Compose with multiple versions, PgBouncer, Pgpool, CockroachDB). Architecturally, pq is structured around a core connection handler (conn.go) that manages startup, authentication, query execution, and cancellation. Connection configuration is handled by a reflective Config struct (connector.go) that maps DSN keys and environment variables to struct fields. Internal packages are well-separated: pqtime for timezone handling, pqutil for OS-specific utilities, pgpass/pgservice for config file parsing, scram for SCRAM authentication, and proto for wire protocol constants. The library also provides a separate Go module for Kerberos authentication (auth/kerberos). Maintenance is active, with recent releases (v1.12.3 in 2026) and ongoing issue triage. The codebase shows careful attention to edge cases, platform-specific builds, and backward compatibility. While some deprecated items exist (e.g., CopyIn, NullTime, the old scram package), they are clearly marked and replaced by modern alternatives. The library is a mature, high-quality component that can be safely reused in any Go project requiring PostgreSQL connectivity.

RATING: 9.4/10 MAINT: active DRIFT: low
â–¸ 5 reusable components found
payloadcms/payload ★ 45020 4233 APPLICATION

Payload CMS is a headless content management system framework built on Next.js and TypeScript. It functions as a full-stack application generator, allowing developers to define content schemas (collections, globals) which automatically produce an admin UI, REST/GraphQL APIs, and database schemas. The architecture is a monorepo utilizing pnpm workspaces, with distinct packages for core logic (packages/payload), the admin interface (packages/ui), and database/storage adapters (packages/drizzle, packages/db-mongodb, packages/storage-*). It heavily leverages Next.js App Router and React Server Components for data fetching and rendering. The system supports polyglot persistence through adapters for PostgreSQL (via Drizzle ORM), MongoDB (via Mongoose), SQLite, and Cloudflare D1. It also abstracts file storage across providers like S3, Azure, GCS, and Vercel Blob. A significant portion of the codebase involves complex integration with the Lexical rich text editor and a robust plugin ecosystem for features like SEO, Ecommerce, and Multi-tenancy. The framework emphasizes developer experience through CLI tools, codemods for version upgrades, and extensive type generation. Maintenance is active with frequent commits and a large test suite covering integration and E2E scenarios. However, the complexity of maintaining multiple database and storage adapters alongside rapid Next.js ecosystem changes introduces a medium level of technical drift risk. Generated files in the admin UI and API routes require careful handling to avoid conflicts during framework updates, and the sheer number of open issues (846) suggests ongoing technical debt management.

RATING: 9.3/10 MAINT: active DRIFT: medium
â–¸ 3 reusable components found
gajus/slonik ★ 4939 156 APPLICATION

Slonik is a production-grade, battle-tested Node.js PostgreSQL client library that emphasizes strict typing, detailed logging, and runtime assertions. It provides a type-safe SQL query interface via tagged template literals (the `sql` tag), connection pooling with configurable lifecycle management, transaction support, and an interceptor (middleware) system for extending query execution, connection handling, and result transformation. The library is structured as a monorepo with multiple packages: core `slonik`, `@slonik/sql-tag` for SQL template construction, `@slonik/driver` and `@slonik/pg-driver` for driver abstraction, `@slonik/errors` for a comprehensive error hierarchy, `@slonik/utilities` for shared utilities, and community interceptor packages for query caching, logging, field name transformation, and DataLoader integration. It integrates with Zod for optional runtime query result validation and uses Roarr for logging. The architecture is modular, with clean separation of concerns, making it suitable for both small projects and large-scale production systems.

RATING: 9.3/10 MAINT: active DRIFT: low
â–¸ 5 reusable components found
piccolo-orm/piccolo ★ 1940 116 APPLICATION

Piccolo is an async-first Python ORM and query builder targeting PostgreSQL, SQLite, and CockroachDB. It provides a declarative table definition system, automatic schema migrations, a CLI for project scaffolding, user authentication, fixture dump/load, and Pydantic model generation. The codebase is well-structured with clean abstractions (column types, query delegates, engine abstraction, migration auto-generation) and an extensive test suite covering multiple database backends. It is actively maintained with frequent releases and supports recent Python and database versions.

RATING: 9.3/10 MAINT: active DRIFT: low
â–¸ 4 reusable components found
HFQR/xitca-web ★ 1009 66 APPLICATION

This is the xitca-web workspace, a high-performance, modular async web framework in Rust. It provides server and client capabilities for HTTP/1, HTTP/2, and HTTP/3, along with WebSocket, gRPC, TLS (rustls, OpenSSL, native-tls), static file serving, content compression (brotli, gzip, deflate, zstd), multipart form handling, and rate limiting. The framework is built on a core `Service`/`ReadyService` trait system that allows composable middleware pipelines, similar to Tower but with its own ergonomic design. It also includes an async PostgreSQL driver with full protocol support, connection pooling, and io_uring integration. The architecture is organized into many focused crates (`xitca-http`, `xitca-server`, `xitca-client`, `xitca-service`, `xitca-router`, `xitca-io`, etc.), all within a single workspace. Key strengths include zero-copy buffer management, custom protocol implementations (HPACK, QPACK) with security mitigation for known HTTP/2 vulnerabilities, and a flexible handler extraction system. The codebase demonstrates high craftsmanship with extensive testing, benchmarks, and security-conscious design, though it contains some unsafe code and has a large feature flag surface.

RATING: 9.3/10 MAINT: active DRIFT: low
â–¸ 5 reusable components found
supabase/supabase-js ★ 4554 732 APPLICATION

This is the Supabase JavaScript SDK monorepo, providing isomorphic client libraries for Supabase backend services. It is a well-structured TypeScript monorepo managed with pnpm and Nx, containing six core packages: auth-js (authentication), postgrest-js (database queries via PostgREST), realtime-js (WebSocket-based realtime subscriptions), storage-js (file storage and vector index API), functions-js (edge function invocation), and the umbrella supabase-js package that combines them into a single `createClient()` entry point. The SDK supports multiple runtimes (Node.js, Deno, browsers, Bun, React Native, Cloudflare Workers) and includes optional OpenTelemetry tracing support. The codebase demonstrates high craftsmanship with extensive TypeScript generics for type-safe query building, fluent builder patterns, robust error handling hierarchies, and comprehensive integration tests against local Supabase infrastructure. It is actively maintained with frequent releases, automated CI/CD, and a strong focus on backward compatibility.

RATING: 9.2/10 MAINT: active DRIFT: low
â–¸ 8 reusable components found
pgcentralfoundation/pgrx ★ 4772 331 APPLICATION

This repository provides **pgrx**, a framework for writing PostgreSQL extensions entirely in Rust. It includes a CLI tool (`cargo-pgrx`) for project scaffolding, building, testing, packaging, and schema generation. The core library (`pgrx`) offers safe Rust wrappers for PostgreSQL internals: memory contexts, SPI (Server Programming Interface), arrays, triggers, aggregates, GUCs, datetime types, and more. Procedural macros (`#[pg_extern]`, `#[pg_trigger]`, `#[pg_aggregate]`, `#[derive(PostgresType)]`, etc.) automatically generate SQL DDL and Rust boilerplate, enabling a pure-Rust extension development experience. The framework supports PostgreSQL versions 13 through 19 via feature-gated FFI bindings in `pgrx-pg-sys`, which uses `bindgen` to produce per-version Rust declarations. SQL schema generation is handled at compile time by `pgrx-sql-entity-graph`, which embeds metadata in the shared library's binary sections. The architecture is modular: the `pgrx` crate re-exports public API, `pgrx-macros` provides proc macros, `pgrx-pg-sys` contains raw FFI bindings, `pgrx-sql-entity-graph` handles SQL generation, and `cargo-pgrx` is the CLI frontend. Example extensions in `pgrx-examples/` demonstrate features like custom types, background workers, logical decoding, and SPI usage. A comprehensive test suite in `pgrx-unit-tests/` includes compile-fail tests, property-based tests (via `proptest`), and integration tests that run against real PostgreSQL instances. Key external dependencies include the PostgreSQL development headers (for `pg_config` and C API), `libclang` for bindgen, and Rust ecosystem crates such as `serde`, `syn`, `quote`, `clap`, `ureq`, and `criterion` (for benchmarking). The framework is designed for extension authors; it is not a data analysis or research project.

RATING: 9.0/10 MAINT: active DRIFT: low
â–¸ 3 reusable components found
BlinkTagInc/node-gtfs ★ 505 158 APPLICATION

node-gtfs is a comprehensive Node.js library and CLI toolkit for ingesting, querying, exporting, and updating GTFS (General Transit Feed Specification) transit data. It supports SQLite natively and PostgreSQL/MySQL through Kysely, handling static schedule feeds, GTFS Realtime (alerts, trip updates, vehicle positions), and extended standards (GTFS-Plus, GTFS-Ride, GTFS-to-HTML, TODS, TIDES, NOPTIS). The architecture centers on a declarative schema definition system that compiles to SQL table metadata, enabling robust import/export pipelines and a rich query API with ~50 getter functions. The codebase demonstrates strong engineering practices: parameterized SQL builders, structured error handling, configurable reporting, and comprehensive test coverage. It is actively maintained, uses modern tooling (pnpm, TypeScript, ESM), and provides a reusable foundation for transit data applications.

RATING: 9.0/10 MAINT: active DRIFT: low
â–¸ 4 reusable components found
prisma/orm ★ 47678 2545 APPLICATION

This is Prisma 8, a next-generation ORM framework written in TypeScript. It provides a contract-driven schema definition system where a 'contract' (JSON + TypeScript types) defines the data model, codecs, extensions, and capabilities. From this contract, the framework generates migrations, a type-safe query builder, and runtime execution for multiple database targets (PostgreSQL, SQLite, MongoDB). The architecture follows a multi-plane design with clear separation between the control plane (schema definition, migration planning, CLI) and the runtime plane (query execution, codec encoding/decoding). The monorepo is organized into layers: foundation (contract IR, canonicalization), core (config, framework components), authoring (PSL parser, contract builder), tooling (CLI, emitter, migration tools), family-specific packages (SQL family, Mongo family), target adapters (Postgres, SQLite, Mongo), and extensions (pgvector, postgis, supabase, etc.). Key entry points include the CLI (packages/1-framework/3-tooling/cli/src/bin.ts), contract definition via defineContract, migration base class, runtime creation (createPostgresRuntime, createMongoRuntime), and the ORM client (Collection). Data flows from contract source (PSL or TypeScript) to contract IR, emission (contract.json + contract.d.ts), migration planning, DDL execution, runtime query building, codec encoding/decoding, and database execution. External dependencies include PostgreSQL (via pg driver), SQLite (via better-sqlite3 or WASM), MongoDB (via mongodb driver), various extensions (pgvector, postgis, etc.), and Node.js/Bun runtimes.

RATING: 8.9/10 MAINT: active DRIFT: medium
â–¸ 6 reusable components found
pgflow-dev/pgflow ★ 309 17 APPLICATION

pgflow is a PostgreSQL/Supabase-native workflow orchestration engine for defining and executing typed DAGs as background jobs. The system is split into six coordinated packages: a PL/pgSQL core (pkgs/core) that implements the complete workflow state machine in the database — flows, steps, runs, step states, tasks, retries with exponential backoff, map/reduce fan-out, conditional step execution, skip-cascade propagation, and realtime event broadcasting — plus a type-safe TypeScript DSL (pkgs/dsl) for declaring flows with compile-time-enforced inputs/outputs, a Deno/edge worker runtime (pkgs/edge-worker) that consumes PGMQ messages and executes step handlers via platform adapters (Supabase vs. plain process), a realtime-subscription client library (pkgs/client), and a CLI (pkgs/cli) for scaffolding new Supabase projects. Execution relies on pgmq for task queues, pg_cron for stalled-task recovery and worker health, pg_net for HTTP worker invocation, supabase_vault for credentials, and Supabase Realtime for atomic state-transition broadcasts.

RATING: 8.9/10 MAINT: active DRIFT: low
â–¸ 5 reusable components found
supabase/supabase ★ 107967 13539 APPLICATION

This is the monorepo for Supabase, the open-source Firebase alternative built on PostgreSQL. The repository contains the complete Supabase platform including: (1) Studio - a Next.js-based management dashboard for database, auth, storage, and edge functions, (2) Docs - a Next.js documentation site with MDX content and search, (3) WWW - the main marketing website, (4) UI packages - shared React component libraries built on Radix UI and Tailwind CSS, (5) pg-meta - a TypeScript library for PostgreSQL metadata introspection, (6) ai-commands - AI/LLM integration tools, (7) Docker configurations for self-hosted deployments, and (8) numerous example applications demonstrating Supabase integrations. The architecture is a pnpm monorepo using Turbo for build orchestration. The codebase demonstrates sophisticated engineering patterns including: a custom SQL query builder with branded types for safe SQL composition (pg-meta), a comprehensive component library with design system tokens, real-time features via WebSockets, row-level security policy management, and a multi-tenant organization/project structure. The repository is actively maintained with recent commits and has strong community engagement (105k+ stars).

RATING: 8.8/10 MAINT: active DRIFT: low
â–¸ 6 reusable components found
Infisical/infisical ★ 29691 2319 APPLICATION

Infisical is an open-source end-to-end encrypted secrets management platform used to centralize, secure, and sync secrets across teams and infrastructure. The codebase is structured as a multi-service application with a primary Node.js/TypeScript backend (REST API using Fastify) and a newer Go backend implementing core platform services (authentication, permission evaluation, KMS, audit logging, secret manager). The frontend is a React SPA built with Vite and TanStack Router. The system supports self-hosted (Docker, Helm) and cloud-deployed modes. It provides a rich set of capabilities including dynamic secrets, secret rotation, approval workflows, machine identity federation (AWS, Azure, GCP, Kubernetes, OIDC), PKI management (internal and external CAs), privileged access management (PAM), secret scanning, audit logging, and extensive integration syncs. The architecture follows a modular service-oriented pattern with clear separation of concerns, extensive use of dependency injection and factory patterns for extensibility.

RATING: 8.8/10 MAINT: active DRIFT: low
â–¸ 4 reusable components found
mfvanek/pg-index-health ★ 202 22 APPLICATION

pg-index-health is an embeddable Java library and schema linter for PostgreSQL that detects common database anti-patterns and promotes best practices. It provides over 40 diagnostic checks covering duplicated/intersected indexes, bloat, missing indexes, inappropriate column types, naming violations, unlogged tables, sequence overflow, and many more. The library is designed for integration into applications (via Spring Boot starter) or use in CI pipelines to enforce schema quality. It supports both single-host and high-availability PostgreSQL clusters, with checks that can run statically (against schema only) or require accumulated statistics. The architecture is a multi-module Gradle project: `pg-index-health-model` defines immutable domain objects (Table, Index, Column, ForeignKey, etc.) with validation and composable predicates; `pg-index-health-core` implements host-level checks using a template pattern (`AbstractCheckOnHost`) with SQL queries loaded from a separate submodule; `pg-index-health` wraps these into cluster-level checks (`AbstractCheckOnCluster`) that aggregate results across primary and standby nodes; `pg-index-health-jdbc-connection` provides connection factories with primary host detection and multi-host URL parsing; `pg-index-health-generator` produces corrective SQL migrations; `pg-index-health-logger` formats results; and `pg-index-health-testing` offers Testcontainers-based test fixtures. Optional Jackson 2/3 modules enable JSON serialization of results. Key entry points include `StandardChecksOnHost` and `StandardChecksOnCluster` which enumerate all available checks, and the Spring Boot auto-configuration (`DatabaseStructureHealthAutoConfiguration`) that registers check beans. Data flows involve querying PostgreSQL system catalogs (`pg_catalog`, `pg_stat_*`), mapping result sets to domain objects via `ResultSetExtractor` implementations, applying exclusion predicates (e.g., skip Flyway/Liquibase tables, small tables, named objects), and returning lists of deviations. External dependencies are minimal: PostgreSQL JDBC driver, Apache DBCP2 connection pool, and Testcontainers for testing. The library is published to Maven Central and includes a BOM for dependency management.

RATING: 8.8/10 MAINT: active DRIFT: low
â–¸ 4 reusable components found
$ loading more...
$ submit: