Skip to content

Conversation

@Hoverbear
Copy link
Contributor

This is based off #51 which is based off #56 so it's a long way from being ready to merge.

CREATE TYPE Dog AS (
    name TEXT,
    scritches INT
);

CREATE FUNCTION last_dog(a Dog[]) RETURNS Dog
    IMMUTABLE STRICT
    LANGUAGE PLRUST AS
$$
    a.into_iter().last().unwrap_or(None)
$$;

@Hoverbear Hoverbear self-assigned this Jul 4, 2022
@Hoverbear Hoverbear mentioned this pull request Jul 4, 2022
Copy link
Contributor

@eeeebbbbrrrr eeeebbbbrrrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Some(String::from_utf8(output.stdout.clone()).expect("`cargo`'s stdout was not UTF-8")),
Some(String::from_utf8(output.stderr.clone()).expect("`cargo`'s stderr was not UTF-8")),
Some(
String::from_utf8(output.stdout.clone()).expect("`cargo`'s stdout was not UTF-8"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra space before UTF-8

String::from_utf8(output.stdout.clone()).expect("`cargo`'s stdout was not UTF-8"),
),
Some(
String::from_utf8(output.stderr.clone()).expect("`cargo`'s stderr was not UTF-8"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@eeeebbbbrrrr
Copy link
Contributor

Should probably look into the CI failures, eh?

Signed-off-by: Ana Hobden <operator@hoverbear.org>
Comment on lines +67 to +72
let composite_type_oid: u32 = unsafe {
let mut typoid = 0;
let mut typmod = 0;
pg_sys::parseTypeString("Dog".as_pg_cstr(), &mut typoid, &mut typmod, false);
typoid
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to find a way to wrap this outside this function before this is acceptable.

@eeeebbbbrrrr
Copy link
Contributor

replaced by PR #311. Not really much actual code difference here -- was just easier to write the few lines of code again rather than deal with the merge conflicts since we've moved files around since this PR was created. #311 also included docs and updated to plrust-trusted-pgrx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants