Skip to content

Method for "including" common code in build and version scripts #43

Description

@jnasbyupgrade

I find myself constantly cut and pasting boilerplate code across extension update scripts. It'd be nice if there was a way to define them in one place, and then somehow include them. There's some precedent to that idea with the idea of .in.sql scripts, but we should have something more standardized:

  • There should be a standard storage location for the files (maybe sql/lib/?)
  • It should be mandatory that the files are versioned. This is a huge potential gotcha; if they're not versioned then a change to a script would affect all scripts that use it, even ones for upgrading from older versions. Technically you could always commit the final form of the update scripts, but IMO the risk just isn't worth it.
  • This is potentially useful for live extension code as well; in particular functions. It would eliminate the need to copy the same code to the main build file as well as an update script (this is assuming you have more than one plain version specification file)
  • There should be make variables to at least disable the pgxntool-based behavior, in case people want to customize things

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions