Skip to content

Commit

Permalink
add object back
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi committed Jan 11, 2024
1 parent 0904360 commit cb893fc
Show file tree
Hide file tree
Showing 91 changed files with 411 additions and 301 deletions.
3 changes: 0 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[target.'cfg(target_os="macos")']
# Postgres symbols won't be available until runtime
rustflags = ["-Clink-arg=-Wl,-undefined,dynamic_lookup"]

[env]
PGRX_EMBED = "../../embed.rs"
45 changes: 43 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions cargo-pgrx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ env_proxy = "0.4.1"
pgrx-pg-config = { path = "../pgrx-pg-config", version = "=0.11.2" }
pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph", version = "=0.11.2" }
prettyplease = "0.2.15"
proc-macro2 = { version = "1.0.76" }
proc-macro2 = { version = "1.0.69", features = [ "span-locations" ] }
quote = "1.0.33"
regex = "1.10.0"
ureq = { version = "2.8.0", default-features = false, features = [ "gzip" ] }
url = "2.4.1"
serde = { version = "1.0", features = [ "derive" ] }
serde_derive = "1.0"
serde-xml-rs = "0.6.0"
syn = { version = "2.0.18", features = ["extra-traits", "full", "fold", "parsing", "visit"] }
syn = { version = "2.0.18", features = [ "extra-traits", "full", "fold", "parsing" ] }
unescape = "0.1.0"
object = "0.32.1"
once_cell = "1.18.0"
eyre = "0.6.8"
color-eyre = "0.6.2"
Expand Down
3 changes: 3 additions & 0 deletions cargo-pgrx/src/command/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ pub(crate) fn install_extension(
features,
&extdir,
&base_directory,
true,
&mut output_tracking,
)?;

Expand Down Expand Up @@ -369,6 +370,7 @@ fn copy_sql_files(
features: &clap_cargo::Features,
extdir: &PathBuf,
base_directory: &PathBuf,
skip_build: bool,
output_tracking: &mut Vec<PathBuf>,
) -> eyre::Result<()> {
let dest = get_target_sql_file(&package_manifest_path, extdir, base_directory)?;
Expand All @@ -385,6 +387,7 @@ fn copy_sql_files(
Some(&dest),
Option::<String>::None,
None,
skip_build,
output_tracking,
)?;

Expand Down
11 changes: 1 addition & 10 deletions cargo-pgrx/src/command/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ pub(crate) fn create_crate_template(
create_dotcargo_config_toml(&path, name)?;
create_lib_rs(&path, name, is_bgworker)?;
create_git_ignore(&path, name)?;
create_embed_rs(&path, name)?;
create_pgrx_rs(&path, name)?;

Ok(())
Expand Down Expand Up @@ -149,20 +148,12 @@ fn create_git_ignore(path: &PathBuf, _name: &str) -> Result<(), std::io::Error>
Ok(())
}

fn create_embed_rs(path: &PathBuf, _name: &str) -> Result<(), std::io::Error> {
let mut filename = path.clone();
filename.push("embed.rs");
let mut file = std::fs::File::create(filename)?;
file.write_all(include_bytes!("../templates/embed_rs"))?;
Ok(())
}

fn create_pgrx_rs(path: &PathBuf, _name: &str) -> Result<(), std::io::Error> {
let mut filename = path.clone();
filename.push("src");
filename.push("bin");
filename.push("pgrx.rs");
let mut file = std::fs::File::create(filename)?;
file.write_all(include_bytes!("../templates/pgrx_rs"))?;
file.write_all(include_bytes!("../templates/pgrx_embed_rs"))?;
Ok(())
}
Loading

0 comments on commit cb893fc

Please sign in to comment.