Skip to content

Conversation

@hiradp
Copy link

@hiradp hiradp commented Jan 21, 2026

Summary

  • Adds a new --columns flag to pscale database dump that allows specifying which columns to include when dumping specific tables
  • Supports multiple tables with format: --columns 'users:id,name' --columns 'orders:id,total'
  • The schema dump will include the complete schema.

Resolves #891

Testing

Added unit tests, but also manual verification against a live database.

$ go run cmd/pscale/main.go \
  database dump hp-msql-ps-10 main --columns "users:email" --columns "products:sku"

tarting to dump all tables from database hp-msql-ps-10 to folder /Users/hirad/code/planetscale/cli/pscale_dump_hp-msql-ps-10_main_20260120_193324
Dumping is finished! (elapsed time: 726.003583ms)

$ cat pscale_dump_hp-msql-ps-10_main_20260120_193324/hp-msql-ps-10.users.00001.sql
INSERT INTO `users`(`email`) VALUES
("bar@baz.test"),
("beta@gamma.test"),
("green@blue.test"),
("banana@cherry.test"),
("moon@star.test"),
("dog@bird.test"),
("south@east.test"),
("paper@scissors.test"),
("pong@ball.test"),
("world@test.test");

$ cat pscale_dump_hp-msql-ps-10_main_20260120_193324/hp-msql-ps-10.products.00001.sql
INSERT INTO `products`(`sku`) VALUES
("abc-123"),
("def-456"),
("ghi-789"),
("jkl-012"),
("mno-345"),
("pqr-678"),
("stu-901"),
("vwx-234"),
("yza-567"),
("bcd-890");

@hiradp hiradp requested a review from a team as a code owner January 21, 2026 00:43
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.

[Feature Request] Filter for only certain columns on pscale database dump

1 participant