Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRFTQ-0008A7-RJ for pgadmin-hackers@arkaria.postgresql.org; Tue, 30 Mar 2021 14:36:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRFTP-0002AN-Hx for pgadmin-hackers@arkaria.postgresql.org; Tue, 30 Mar 2021 14:36:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lR1Vm-00012Z-V0 for pgadmin-hackers@lists.postgresql.org; Mon, 29 Mar 2021 23:41:35 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lR1Vk-0006Ay-OX for pgadmin-hackers@postgresql.org; Mon, 29 Mar 2021 23:41:33 +0000 Received: by mail-ot1-x336.google.com with SMTP id v24-20020a9d69d80000b02901b9aec33371so13914614oto.2 for ; Mon, 29 Mar 2021 16:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=supabase.io; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=apT6uQgW+aaq7rVHfXx2EWXbQWy2AnGIop5CI8CKQSU=; b=rq5lp+71CQGtt2u4SXyTWlL7usAz3CtePz4MShWPBA7PxTc/FK4xWxABlpXzDMTzKf aaFZXWOR++WhmGt/mmeb2z7ktSR2MsAoPDYejH1vVBxJZ3Bxkoqd9Z3fTC8nd1twxEWF skTGY2LSJjfYROppwYX4BU0XODcLUnumh0IJm12J0ELbDzyfytzoA00W9oPSFJUBWNyH hRpWKE21Uhw+ceYLRG4WJSwsKPCWTD2JNl5F+DgiB6tPKZTVg2KhLOdOR4LH85T71lhO OR4dnK96tmCL4z/co1kVWwRNt0EumN7TEBaj42NxePGHYqTydAMEhRObwHVpZEKXli98 5CxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=apT6uQgW+aaq7rVHfXx2EWXbQWy2AnGIop5CI8CKQSU=; b=MoC4Eijg61K2C8IAMu8BiTO/qlrTXu9TOT/YEx2wGugMmcR3ip9t1GwA2lp9PxAkHp Oaql/V4ZhH149bIEqEFKzHU+Oej/sqoUU33n937wSVxVuzNN4/AWMNdVDcknnY+yj0+h 7qnb2kV2UnzHN/dXSpdScjI55ljKUcpZUzkeSxJwfIXl2lTBvJ/jYyjM+hInxDB7byv5 gat2IlovvKBEW96bREb+YzL5v3ZwEYT902f57Jq/Za0veDDugiCjo7EmDFObB/S9rmSC TeWMBxQK/HI1b4lCCQBZufXT8Zujy4PGc0LYbQi67BPk5swSUDnD9Xhm8t3ik3UTjVKh Jprg== X-Gm-Message-State: AOAM532PnlWT3BHR1SAWZ50IKxRb27nWszDdzJnoW+loHGPmsf+cWekx WhOwaIU3/OBrGakiS1Q+3SB3mWydO/MqgqHLq26kDl6Uepll6A== X-Google-Smtp-Source: ABdhPJwVJyVe3KTLb++zCEFjiaLY/r0HnIiJo1AaOsqH0sqVfookC0qBqRC2f7p3FNCQk81qf7D8PqRLnh1RR71ffSo= X-Received: by 2002:a9d:63d4:: with SMTP id e20mr24848812otl.135.1617061291159; Mon, 29 Mar 2021 16:41:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Steve Chavez Date: Mon, 29 Mar 2021 18:41:20 -0500 Message-ID: Subject: Re: CLI for Schema Diff To: pgadmin-hackers@postgresql.org Content-Type: multipart/alternative; boundary="000000000000d707e005beb56b4f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d707e005beb56b4f Content-Type: text/plain; charset="UTF-8" Hey all, In case anyone is interested, I've managed to enable a CLI mode for the Schema Diff on this repo: https://github.com/steve-chavez/pgadmin4/blob/cli/web/cli.py It basically works by using a Flask test client that interacts with the Schema Diff endpoints. It's a single isolated file, I haven't patched any of the existing modules. For a quickstart, there's also a docker image that can be used like: docker run supabase/pgadmin-schema-diff \ 'postgres://postgres@host/diff_source' \ 'postgres://postgres@host/diff_target' \ > diff.sql ## the stderr output shows the same messages as the Schema Diff GUI: Starting schema diff... Comparision started......0% Comparing FTS Dictionaries ...35% Comparing Functions ...50% Comparing Trigger Functions ...60% Comparing Sequences ...70% Comparing Tables ...80% Comparing Views ...90% Done. On Wed, 10 Mar 2021 at 13:42, Steve Chavez wrote: > Hey all, > > The Schema Diff tool is amazing, works much better than all the current > OSS alternatives. > > However, it's only possible to use it from the GUI and thus it cannot be > used programmatically, which would be really useful for CI/CD > environments(deployment automation). > > Would you guys be open to make the Schema Diff work through a CLI? > > Best regards, > Steve > --000000000000d707e005beb56b4f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey all,

In case anyone is interested, I've ma= naged to enable a CLI mode for the Schema Diff on this repo:

=
https://github.com/steve-chavez/pgadmin4/blob/cli/web/cli.py

It basically works by using a Flask test client that = interacts with the Schema Diff endpoints.
It's a single isola= ted file, I haven't patched any of the existing modules.

=
For a quickstart, there's also a docker image that can be us= ed like:

docker run supabase/pga=
dmin-schema-diff \
'postgres://postgr= es@host/diff_source' \
'postgres:= //postgres@host/diff_target' \
> d= iff.sql ## the stderr output shows the same messages as the = Schema Diff GUI:
Starting sche=
ma diff...
Comparision started......0%
Comparing FTS Dictionaries ...35%
Comparing Functions ...50%
Comparing Trigger Functions ...60%
Compa= ring Sequences ...70%
Comparing Tables ...8= 0%
Comparing Views ...90%
Done.

=
On Wed, 10 Mar 2021 at 13:42, Steve C= havez <steve@supabase.io> wr= ote:
Hey all,

The Schema Diff tool is amazing, works mu= ch better than all the current OSS alternatives.

H= owever, it's only possible to use it from the GUI and thus it cannot be= used programmatically, which would be really useful for CI/CD environments= (deployment automation).

Would you guys be open=C2= =A0to make the=C2=A0Schema Diff work through a CLI?

Best regards,
Steve
--000000000000d707e005beb56b4f--