8000 feat: update oriole extension to beta9 by samrose · Pull Request #1407 · supabase/postgres · GitHub
[go: up one dir, main page]

Skip to content

feat: update oriole extension to beta9 #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.0.1.018-orioledb"
postgres15: "15.8.1.028"
postgresorioledb-17: "17.0.1.019-orioledb"
postgres15: "15.8.1.029"

# Non Postgres Extensions
pgbouncer_release: "1.19.0"
Expand Down
56 changes: 22 additions & 34 deletions migrations/schema-orioledb-17.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ CREATE SCHEMA auth;
CREATE SCHEMA extensions;


--
-- Name: graphql; Type: SCHEMA; Schema: -; Owner: -
--

CREATE SCHEMA graphql;


--
-- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: -
--
Expand Down Expand Up @@ -94,6 +101,20 @@ CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA public;
COMMENT ON EXTENSION orioledb IS 'OrioleDB -- the next generation transactional engine';


--
-- Name: pg_graphql; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pg_graphql WITH SCHEMA graphql;


--
-- Name: EXTENSION pg_graphql; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION pg_graphql IS 'pg_graphql: GraphQL support';


--
-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: -
--
Expand Down Expand Up @@ -484,39 +505,6 @@ $_$;
COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql';


--
-- Name: graphql(text, text, jsonb, jsonb); Type: FUNCTION; Schema: graphql_public; Owner: -
--

CREATE FUNCTION graphql_public.graphql("operationName" text DEFAULT NULL::text, query text DEFAULT NULL::text, variables jsonb DEFAULT NULL::jsonb, extensions jsonb DEFAULT NULL::jsonb) RETURNS jsonb
LANGUAGE plpgsql
AS $$
DECLARE
server_version float;
BEGIN
server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float);

IF server_version >= 14 THEN
RETURN jsonb_build_object(
'errors', jsonb_build_array(
jsonb_build_object(
'message', 'pg_graphql extension is not enabled.'
)
)
);
ELSE
RETURN jsonb_build_object(
'errors', jsonb_build_array(
jsonb_build_object(
'message', 'pg_graphql is only available on projects running Postgres 14 onwards.'
)
)
);
END IF;
END;
$$;


--
-- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: -
--
Expand Down Expand Up @@ -625,7 +613,7 @@ CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger

SET default_tablespace = '';

SET default_table_access_method = heap;
SET default_table_access_method = orioledb;

--
-- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: -
Expand Down
18 changes: 12 additions & 6 deletions nix/ext/orioledb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,25 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "orioledb";
repo = "orioledb";
rev = "beta8";
sha256 = "sha256-niyTQr1FQYEsKdxl/uVrKSiIR0DCnnT+DDkW47lsc80=";
rev = "beta9";
sha256 = "sha256-z2EHWsY+hhtnYzAxOl2PWjqfyJ+wp9SCau5LKPT2ec0=";
};
version = "beta8";
version = "beta9";
buildInputs = [ curl libkrb5 postgresql python3 openssl ];
buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=5";
installPhase = ''
runHook preInstall

mkdir -p $out/{lib,share/postgresql/extension}

cp *${postgresql.dlSuffix} $out/lib
cp *.sql $out/share/postgresql/extension
cp *.control $out/share/postgresql/extension
# Copy the extension library
cp orioledb${postgresql.dlSuffix} $out/lib/

# Copy sql files from the sql directory
cp sql/*.sql $out/share/postgresql/extension/

# Copy control file
cp orioledb.control $out/share/postgresql/extension/

runHook postInstall
'';
Expand Down
Loading
Loading
0