All skills
macro-inc avatar

/dump-schema

@e637554
by Macromacro-inc/macro4.5k stars
435

Dump clean Postgres schema to a file and copy path to clipboard.

  • 1 file
  • 990 B
  • Updated 8 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/macro-inc/macro/dump-schema

This session only. Nothing lands on disk.

SKILL.md

≈19 tokens always: the name and description. ≈216 when used: this file.

Dump Schema

Dump a clean PostgreSQL schema (no comments, no ownership, no privileges) from the local dev database.

Parameters

Ask the user (if not provided):

  • output_file – absolute path for the .sql file (default: prompt user)

Use this database URL unless the user specifies otherwise:

postgres://user:password@localhost:5432/macrodb

Steps

  1. Run pg_dump with schema-only flags, pipe through cleanup, write to file:
pg_dump --schema-only --no-owner --no-privileges --no-comments --no-publications --no-subscriptions --no-security-labels --no-tablespaces "$DB_URL" | sed '/^--/d' | sed '/^SET /d' | sed '/^SELECT pg_catalog/d' | sed '/^$/N;/^\n$/d' > "$OUTPUT_FILE"
  1. Copy the output path to the clipboard:
echo -n "$OUTPUT_FILE" | pbcopy
  1. Report: Schema dumped to <path> (path copied to clipboard)

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at e637554. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 8 months ago
What it can do
Runs commands
All 1 allowed tools
Bash

README badge

README badge for macro-inc/macro/dump-schema