Skip to content

Conversation

@eminano
Copy link
Collaborator

@eminano eminano commented Nov 12, 2025

Description

This PR adds role handling for Xata databases. It also adds onboarding documentation.

Onboarding guide preview link.

Related Issue(s)

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)
  • 📚 Documentation update

Changes Made

  • Skip xata managed roles from role snapshotting
  • Add xata onboarding guide
  • Add postgres to excluded roles

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Xata databases by implementing role handling for Xata-managed roles and providing comprehensive onboarding documentation.

  • Excludes Xata-managed roles (xata, xata_superuser) and the postgres role from role snapshotting
  • Adds comprehensive Xata onboarding guide covering snapshots and replication workflows
  • Updates test fixtures to reflect the exclusion of the postgres role

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/snapshot/generator/postgres/schema/pgdumprestore/pg_role_parser.go Adds postgresRole constant, pgXataRoles map, and updates isExcludedRole() to exclude postgres and Xata-managed roles
pkg/snapshot/generator/postgres/schema/pgdumprestore/test/test_dump_filtered.sql Updates test fixture to use test_role instead of postgres role, removes postgres ownership statements
pkg/snapshot/generator/postgres/schema/pgdumprestore/test/test_dump.sql Updates test fixture to use test_role instead of postgres role
docs/xata.md Adds comprehensive Xata onboarding guide with snapshot/replication setup instructions and troubleshooting
docs/privileges.md Adds reference to new Xata onboarding guide
README.md Adds Xata documentation link and removes extraneous blank lines
Comments suppressed due to low confidence (1)

pkg/snapshot/generator/postgres/schema/pgdumprestore/pg_role_parser.go:1

  • The TestIsExcludedRole test lacks coverage for the newly added Xata roles (xata, xata_superuser) and the postgres role exclusion. Add test cases for xata, xata_superuser, and postgres to verify they are correctly excluded.
// SPDX-License-Identifier: Apache-2.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@gulcin gulcin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eminano eminano enabled auto-merge November 14, 2025 16:29
@eminano eminano merged commit aa24679 into main Nov 14, 2025
7 checks passed
@eminano eminano deleted the xata-db-support branch November 14, 2025 16:33
@github-actions
Copy link

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgstream/pkg/snapshot/generator/postgres/schema/pgdumprestore 89.83% (-0.34%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgstream/pkg/snapshot/generator/postgres/schema/pgdumprestore/pg_role_parser.go 98.06% (-0.92%) 103 (+5) 101 (+4) 2 (+1) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test pgstream against Xata

4 participants