Skip to main content

Announcing platter v0.8.0

Alex Pearson

Alex Pearson

Platter CTO

We're proud to release v0.8.0 of the platter CLI, featuring improved watch performance, new list output types, trunk configuration for new instances, and arbitrary branching of Postgres data!

Getting Started#

To get started with Platter's branching Postgres databases for the first time, take a look at the Quick Start.

To install update to v0.8.0, follow the installation instructions.

About This Release#

This is a particularly exciting release for the Platter team, as we're now realizing one of the core ideas of branchstack: the ability to create branches from any branch, not just the default branch of an instance. Pre-0.8.0 behavior on platter postgres branch create or platter watch was to create branches from the default branch of the Postgres instance. With v0.8.0, new branches can be based on any other active branch, giving you the ability to build richer workflows using a single instance!

Along with this new superpower, we've focused on making the development experience with these new branches more fluid with our new streaming output types for list commands and clearer messages during watch cycles.

Features#

Configurable Instance Trunks#

New Postgres instances can now be created with a trunk branch of any name. Previous behavior was to create a trunk named master for every new instance. With v0.8.0 of the CLI, trunks can be specified explicitly during instance creation and will be inferred from the context of the working git repository when working with any of the Development Commands or create commands.

  • platter postgres create now has a -t or --trunk option for explicitly naming the trunk of an instance. For example, to create a new instance with a trunk called main, you would use:

    platter postgres create my-new-instance --trunk main
  • platter postgres create will also derive a reasonable default name for the new instance's trunk when --trunk is omitted by using the following rules:

    1. if the command is run from inside a git repository, the HEAD branch of the origin remote will be used (if it exists)
    2. if origin/HEAD does not exist, then the init.defaultbranch in the local git configuration will be used
    3. if no defaultbranch is configured, and there is a master or main branch in the local repository, then that branch name will be used
    4. if the command is not run from inside a git repository, then main will be used

Arbitrary Branching#

Create branches from any "parent" branch.

  • platter postgres branch create now has a -p or --parent option for specifying an existing, active branch to copy when creating the new branch's database. For example, to create a new branch called testing from a feature branch called development on an instance called my-instance, you would use:

    platter postgres branch create testing \
    --parent development \
    --instance my-instance

    When --parent is omitted, new branches will use their instance's trunk as their parent branch.

  • platter watch will also derive reasonable parent branches for new branches based on the current active branch of a git repository using the following rules:

    1. watch will not overwrite the parent branch of any existing branch
    2. if watch is invoked on a git branch that does not have a matching Postgres branch, then a new Postgres branch will be created using the instance's trunk branch as the parent.
    3. when the git branch changes while watch is running, watch will create new Postgres branches using the previous branch as the parent of any new branches that need to be created.

New list Output Types#

In addition to list's previous formatted-table output, list commands now have additional output types to make it easier to quickly get information about active Postgres instances and branches. platter postgres list and platter branch list will now use a -o or --output option to choose between table, text, json, and ndjson output types. For example, to get a stream of instance names with platter and jq, you would use:

platter postgres list --output ndjson | jq .name

table remains the default if --output is omitted.

For more information about each output type, see the table below:

TypeDescriptionStreamingUsed with
tableFormatted rows + columnsNoN/A
jsonAggregated JSON ArrayNoJSON file redirection
textTAB-delimited data streamed by lineYesawk, grep
ndjsonNewline-delimited JSON ObjectsYesjq

Deprecations#

With this release, we are also officially deprecating platter versions before 0.7.0.

Support and Feedback#

Thanks for giving this release a try! If you have any questions or feedback about this release, please let us know by email at [email protected] or through the #kitchen Slack channel available for paid users of the shared database tier.