xata-postgres-platform
Expert skill for Xata open-source cloud-native Postgres platform with copy-on-write branching, scale-to-zero, and Kubernetes deployment
What this skill does
# Xata Postgres Platform > Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection. Xata is an open-source, cloud-native Postgres platform built on Kubernetes that provides copy-on-write (CoW) branching, scale-to-zero, auto-scaling, high-availability, PITR backups, and a serverless SQL driver. It sits on top of [CloudNativePG](https://github.com/cloudnative-pg/cloudnative-pg) and [OpenEBS](https://github.com/openebs/openebs). ## Architecture Overview ``` ┌─────────────────────────────────────────────────────┐ │ Xata Platform │ │ CLI ──► REST API (clusters/projects services) │ │ SQL Gateway (routing, scale-to-zero wakeup) │ │ Branch Operator (manages K8s resources per branch) │ │ Auth Service (Keycloak-based, RBAC API keys) │ ├─────────────────────────────────────────────────────┤ │ CloudNativePG (HA, failover, backups, pooling) │ │ OpenEBS (local NVMe or Mayastor replicated storage) │ └─────────────────────────────────────────────────────┘ ``` ## Prerequisites - Docker - [Kind](https://github.com/kubernetes-sigs/kind) - [Tilt](https://github.com/tilt-dev/tilt) - `kubectl` ## Local Development Setup ### Step 1: Create Kind Cluster ```bash kind create cluster --wait 10m ``` ### Step 2: Deploy with Tilt ```bash tilt up ``` Wait for all resources to become ready. First run downloads images and takes longer; subsequent runs are fast. ### Step 3: Install and Authenticate the CLI ```bash # Install Xata CLI curl -fsSL https://xata.io/install.sh | bash # Authenticate to local profile # Default credentials: [email protected], password=Xata1234! xata auth login --profile local --env local --force # Switch to the local profile xata auth switch local ``` ### Step 4: Create Project and Branch ```bash # Create a new project xata project create --name my-project # Create the main branch (done automatically with project) # Create a child branch (CoW copy of parent) xata branch create ``` ## CLI Reference ### Authentication ```bash # Login to Xata Cloud xata auth login # Login to self-hosted local instance xata auth login --profile local --env local --force # Switch between profiles xata auth switch local xata auth switch default # List profiles xata auth list ``` ### Projects ```bash # Create a project xata project create --name my-project # List projects xata project list # Get project details xata project get <project-id> # Delete a project xata project delete <project-id> ``` ### Branches ```bash # Create a branch (CoW snapshot of parent, completes in seconds even for TB of data) xata branch create # Create a named branch from a specific parent xata branch create --name feature-xyz --from main # List branches xata branch list # Get branch details xata branch get <branch-id> # Delete a branch xata branch delete <branch-id> ``` ### Connecting to a Branch ```bash # Get connection string for a branch xata branch connection-string <branch-id> # Connect via psql psql "$(xata branch connection-string <branch-id>)" ``` ## Configuration ### Environment Variables ```bash # Xata API endpoint (for self-hosted) export XATA_API_URL=http://localhost:8080 # API key for authentication export XATA_API_KEY=your_api_key_here # Default project ID export XATA_PROJECT_ID=your_project_id ``` ### API Key Management (RBAC) ```bash # Create an API key with specific permissions xata apikey create --name ci-key --role branch:read,branch:write # List API keys xata apikey list # Revoke an API key xata apikey delete <key-id> ``` ## Serverless SQL Driver (SQL over HTTP/WebSockets) Xata exposes a serverless driver for executing SQL over HTTP or WebSockets, useful for edge functions and environments without persistent TCP connections. ### HTTP SQL Query (Go) ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" "os" ) type SQLRequest struct { Query string `json:"query"` Params []any `json:"params,omitempty"` } type SQLResponse struct { Records []map[string]any `json:"records"` Error string `json:"error,omitempty"` } func queryXata(query string, params ...any) (*SQLResponse, error) { apiURL := os.Getenv("XATA_API_URL") apiKey := os.Getenv("XATA_API_KEY") branchID := os.Getenv("XATA_BRANCH_ID") reqBody := SQLRequest{Query: query, Params: params} data, err := json.Marshal(reqBody) if err != nil { return nil, err } url := fmt.Sprintf("%s/branches/%s/sql", apiURL, branchID) req, err := http.NewRequest("POST", url, bytes.NewReader(data)) if err != nil { return nil, err } req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err } defer resp.Body.Close() var sqlResp SQLResponse if err := json.NewDecoder(resp.Body).Decode(&sqlResp); err != nil { return nil, err } return &sqlResp, nil } func main() { result, err := queryXata("SELECT id, name FROM users WHERE active = $1", true) if err != nil { panic(err) } for _, record := range result.Records { fmt.Printf("User: %v\n", record) } } ``` ### Direct Postgres Connection (Go) ```go package main import ( "context" "fmt" "os" "github.com/jackc/pgx/v5" ) func main() { connStr := os.Getenv("XATA_DATABASE_URL") // e.g. postgresql://user:pass@sql-gateway-host:5432/dbname conn, err := pgx.Connect(context.Background(), connStr) if err != nil { fmt.Fprintf(os.Stderr, "Unable to connect: %v\n", err) os.Exit(1) } defer conn.Close(context.Background()) rows, err := conn.Query(context.Background(), "SELECT id, name FROM users LIMIT 10") if err != nil { panic(err) } defer rows.Close() for rows.Next() { var id int var name string if err := rows.Scan(&id, &name); err != nil { panic(err) } fmt.Printf("id=%d name=%s\n", id, name) } } ``` ## Common Patterns ### Preview Environment Workflow (CI/CD) Create a per-PR branch for isolated testing, then destroy it after merge: ```bash #!/usr/bin/env bash # create-preview.sh set -euo pipefail PR_NUMBER="${1:?PR number required}" BRANCH_NAME="pr-${PR_NUMBER}" # Create a CoW branch from main (completes in seconds, even for TB of data) BRANCH_ID=$(xata branch create --name "$BRANCH_NAME" --from main --output json | jq -r '.id') echo "Created branch: $BRANCH_ID" # Get connection string for tests CONN_STR=$(xata branch connection-string "$BRANCH_ID") echo "::set-output name=database_url::${CONN_STR}" echo "::set-output name=branch_id::${BRANCH_ID}" ``` ```bash #!/usr/bin/env bash # cleanup-preview.sh BRANCH_ID="${1:?Branch ID required}" xata branch delete "$BRANCH_ID" echo "Deleted branch $BRANCH_ID" ``` ### GitHub Actions Integration ```yaml name: Preview Environment on: pull_request: types: [opened, synchronize] jobs: create-preview: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Xata CLI run: curl -fsSL https://xata.io/install.sh | bash - name: Authenticate env: XATA_API_KEY: ${{ secrets.XATA_API_KEY }} run: xata auth login --api-key "$XATA_API_KEY" - name: Create Preview Branch id: branch run: | BRANCH_ID=$(xata branch create \ --name "pr-${{ github.event.number }}" \ --from main \ --output json | jq -r '.id') echo "branch_id=$BRANCH_ID" >> "$GITHUB_OUTPUT" CONN=$(xata branch connection-string "$BRANCH_ID") echo "database_url=$CONN" >> "$GITHUB_OUTPUT" - name: Run Tests env: DATABASE_URL: ${{ steps.branch.outputs.database_url }} run: go test ./... cleanup: runs-on: ubuntu-latest
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.