Aquameta's extensions, except for meta and bundle (the bootstrap), should be converted to bundles. The extension-to-bundle.sql script is the first of such experiments, but it can be a lot better. Using techniques learned from the meta id generator, we can do some incredible stuff.
Converting extensions to bundles will mean that we can have robust bundle dependencies, and in the future, do all Aquameta development within the bundle VCS, including core. It means everything will be data except for the bootstrap. We'll be free of the extension system's many shortcomings. It means future updates to Aquameta will just be another bundle pull.
General approach:
- Call function
extension_to_bundle(extension_name, bundle_name):
- Create a new bundle $bundle_name
- Look up the contents of the extension
- For aquameta's extensions, they're simply divided by schema name, but this isn't true for every extension in the world. Do we care?
- We could use
pg_catalog.pg_depends which is where the contents of an extension is stored (by oid :/)
- Find those rows in the
meta catalog
- Track, stage and commit those rows
- Drop the extension
- Checkout the bundle
Open questions:
- PostgreSQL doesn't retain the original source code for, say, a CREATE TABLE statement. You can get some of the entity definitions back out, but it's not the original source code, but rather PostgreSQL's internal representation, then re-serialized back out. (plpgsql functions are an exception). When everything is data, where is the source code? We probably want to retain that somewhere.
Aquameta's extensions, except for
metaandbundle(the bootstrap), should be converted to bundles. The extension-to-bundle.sql script is the first of such experiments, but it can be a lot better. Using techniques learned from the meta id generator, we can do some incredible stuff.Converting extensions to bundles will mean that we can have robust bundle dependencies, and in the future, do all Aquameta development within the bundle VCS, including core. It means everything will be data except for the bootstrap. We'll be free of the extension system's many shortcomings. It means future updates to Aquameta will just be another bundle pull.
General approach:
extension_to_bundle(extension_name, bundle_name):pg_catalog.pg_dependswhich is where the contents of an extension is stored (by oid :/)metacatalogOpen questions: