cargo-pgx template support#490
Closed
jamessewell wants to merge 1 commit intopgcentralfoundation:developfrom
Closed
cargo-pgx template support#490jamessewell wants to merge 1 commit intopgcentralfoundation:developfrom
cargo-pgx template support#490jamessewell wants to merge 1 commit intopgcentralfoundation:developfrom
Conversation
…o-pgx to replace the previous bgworker config All files are templated out of the ./src/templates directories Possible to do: - check (at compile time) that templates have a MVP list of files (./src/lib.rs, Cargo.toml etc..) - Build (at compile time) a list of ./src/template directories to include (static atm)
cargo-pgx template support
Hoverbear
reviewed
Mar 30, 2022
cargo-pgx/Cargo.toml
Outdated
| @@ -1,41 +1,74 @@ | |||
| [package] | |||
| name = "cargo-pgx" | |||
Contributor
There was a problem hiding this comment.
There seems to be quite a bit of unrelated changes in this file.
Hoverbear
reviewed
Mar 30, 2022
| pub(crate) struct New { | ||
| /// The name of the extension | ||
| name: String, | ||
| /// Create a background worker template |
Contributor
There was a problem hiding this comment.
Suggested change
| /// Create a background worker template | |
| /// Create an extension from a template |
Hoverbear
reviewed
Mar 30, 2022
|
|
||
| // This is an example of a basic agg which adds values to a HashSet | ||
| // then returns the number of elements which have been added | ||
| // see https://hoverbear.org/blog/postgresql-aggregates-with-rust/ for more examples |
Contributor
There was a problem hiding this comment.
Ah, we should add this to /articles in the repo...
Hoverbear
reviewed
Mar 30, 2022
| pg_module_magic!(); | ||
|
|
||
| #[derive(Copy, Clone, Default, Debug)] | ||
| pub struct {{ camel-case name }}; |
Contributor
There was a problem hiding this comment.
It's a bit unfortunate how the template syntax is so similar to Rust :|
Contributor
|
All in all I'm pretty pleased with this @jamessewell . :) In your commit you mentioned this was a first go, are you planning on making further changes or should I take it for a spin? |
Contributor
|
Looks like this has bitrotted quite a bit. @jamessewell if you wanted to bring this up to modern times I'd be happy to help get your vision over the finish line. Until then, I'm closing this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They replace the previous single shot bgworker config switch
All files are templated out of the
./src/templatesdirectoriesPossible to do:
./src/lib.rs,Cargo.tomletc..)./src/templatedirectories to include (static atm)