{"id":13773364,"url":"https://github.com/pgadmin-org/pgadmin4","last_synced_at":"2025-05-13T20:22:24.767Z","repository":{"id":37692449,"uuid":"82552640","full_name":"pgadmin-org/pgadmin4","owner":"pgadmin-org","description":"pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.","archived":false,"fork":false,"pushed_at":"2025-04-29T09:37:46.000Z","size":327916,"stargazers_count":2889,"open_issues_count":368,"forks_count":729,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-04-29T17:47:01.936Z","etag":null,"topics":["administration","database","dba","management","postgres","postgresql","postgresql-database"],"latest_commit_sha":null,"homepage":"https://www.pgadmin.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pgadmin-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-20T11:54:13.000Z","updated_at":"2025-04-29T11:23:18.000Z","dependencies_parsed_at":"2023-10-25T14:54:17.868Z","dependency_job_id":"7a685a1a-755f-448b-9957-d04189eaa371","html_url":"https://github.com/pgadmin-org/pgadmin4","commit_stats":{"total_commits":7302,"total_committers":178,"mean_commits":41.02247191011236,"dds":0.8123801698164886,"last_synced_commit":"0ab5e0d4efc9cc8c7df32703326590a24b209eb6"},"previous_names":["postgres/pgadmin4"],"tags_count":111,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgadmin-org%2Fpgadmin4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgadmin-org%2Fpgadmin4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgadmin-org%2Fpgadmin4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgadmin-org%2Fpgadmin4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgadmin-org","download_url":"https://codeload.github.com/pgadmin-org/pgadmin4/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251583664,"owners_count":21612881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["administration","database","dba","management","postgres","postgresql","postgresql-database"],"created_at":"2024-08-03T17:01:14.814Z","updated_at":"2025-04-29T21:22:38.165Z","avatar_url":"https://github.com/pgadmin-org.png","language":"Python","funding_links":[],"categories":["Databases","Cool Apps","数据库管理系统","Python","Uncategorized"],"sub_categories":["网络服务_其他","Uncategorized"],"readme":"# pgAdmin 4\n\npgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the\nPostgreSQL (http://www.postgresql.org) database.\n\nIn the following documentation and examples, *$PGADMIN4_SRC/* is used to denote\nthe top-level directory of a copy of the pgAdmin source tree, either from a\ntarball or a git checkout.\n\n## Architecture\n\npgAdmin 4 is written as a web application with Python(Flask) on the server side\nand ReactJS, HTML5 with CSS for the client side processing and UI.\n\nAlthough developed using web technologies, pgAdmin 4 can be deployed either on\na web server using a browser, or standalone on a workstation. The runtime/\nsubdirectory contains an Electron based runtime application intended to allow this,\nwhich will fork a Python server process and display the UI.\n\n## Prerequisites\n1. Install Node.js 20 and above (https://nodejs.org/en/download)\n2. yarn (https://yarnpkg.com/getting-started/install)\n3. Python 3.8 and above (https://www.python.org/downloads/)\n4. PostgreSQL server (https://www.postgresql.org/download)\n\nStart by enabling Corepack, if it isn't already;\nthis will add the yarn binary to your PATH:\n```bash\ncorepack enable\n```\n\n# Building the Web Assets\n\npgAdmin is dependent on a number of third party Javascript libraries. These,\nalong with it's own Javascript code, CSS code and images must be\ncompiled into a \"bundle\" which is transferred to the browser for execution\nand rendering. This is far more efficient than simply requesting each\nasset as it's needed by the client.\n\nTo create the bundle, you will need the 'yarn' package management tool to be\ninstalled. Then, you can run the following commands on a *nix system to\ndownload the required packages and build the bundle:\n\n```bash\n(venv) $ cd $PGADMIN4_SRC\n(venv) $ make install-node\n(venv) $ make bundle\n```\n\nOn Windows systems (where \"make\" is not available), the following commands\ncan be used:\n\n```\nC:\\\u003e cd $PGADMIN4_SRC\\web\nC:\\$PGADMIN4_SRC\\web\u003e yarn install\nC:\\$PGADMIN4_SRC\\web\u003e yarn run bundle\n```\n\n# Configuring the Python Environment\n\nIn order to run the Python code, a suitable runtime environment is required.\nPython version 3.8 and later are currently supported. It is recommended that a\nPython Virtual Environment is setup for this purpose, rather than using the\nsystem Python environment. On Linux and Mac systems, the process is fairly\nsimple - adapt as required for your distribution:\n\n1. Create a virtual environment in an appropriate directory. The last argument is\n   the name of the environment; that can be changed as desired:\n\n   ```bash\n   $ python3 -m venv venv\n   ```\n\n2. Now activate the virtual environment:\n\n   ```bash\n   $ source venv/bin/activate\n   ```\n\n3. Some of the components used by pgAdmin require a very recent version of *pip*,\n   so update that to the latest:\n\n   ```bash\n   $ pip install --upgrade pip\n   ```\n\n4. Ensure that a PostgreSQL installation's bin/ directory is in the path (so\n   pg_config can be found for building psycopg3), and install the required\n   packages:\n\n   ```bash\n   (venv) $ PATH=$PATH:/usr/local/pgsql/bin pip install -r $PGADMIN4_SRC/requirements.txt\n   ```\n\n   If you are planning to run the regression tests, you also need to install\n   additional requirements from web/regression/requirements.txt:\n\n   ```bash\n   (venv) $ pip install -r $PGADMIN4_SRC/web/regression/requirements.txt\n   ```\n\n5. Create a local configuration file for pgAdmin. Edit\n   $PGADMIN4_SRC/web/config_local.py and add any desired configuration options\n   (use the config.py file as a reference - any settings duplicated in\n   config_local.py will override those in config.py). A typical development\n   configuration may look like:\n\n    ```python\n   import os\n   import logging\n\n   # Change pgAdmin data directory\n   DATA_DIR = '/Users/myuser/.pgadmin_dev'\n\n   #Change pgAdmin server and port\n   DEFAULT_SERVER = '127.0.0.1'\n   DEFAULT_SERVER_PORT = 5051\n\n   # Switch between server and desktop mode\n   SERVER_MODE = True\n\n   #Change pgAdmin config DB path in case external DB is used.\n   CONFIG_DATABASE_URI=\"postgresql://postgres:postgres@localhost:5436/pgadmin\"\n\n   #Setup SMTP\n   MAIL_SERVER = 'smtp.gmail.com'\n   MAIL_PORT = 465\n   MAIL_USE_SSL = True\n   MAIL_USERNAME = 'user@gmail.com'\n   MAIL_PASSWORD = 'xxxxxxxxxx'\n\n   # Change log level\n   CONSOLE_LOG_LEVEL = logging.INFO\n   FILE_LOG_LEVEL = logging.INFO\n\n   # Use a different config DB for each server mode.\n   if SERVER_MODE == False:\n     SQLITE_PATH = os.path.join(\n         DATA_DIR,\n         'pgadmin4-desktop.db'\n     )\n   else:\n     SQLITE_PATH = os.path.join(\n         DATA_DIR,\n         'pgadmin4-server.db'\n     )\n   ```\n\n   This configuration allows easy switching between server and desktop modes\n   for testing.\n\n6. The initial setup of the configuration database is interactive in server\n   mode, and non-interactive in desktop mode. You can run it either by\n   running:\n\n   ```bash\n   (venv) $ python3 $PGADMIN4_SRC/web/setup.py\n   ```\n\n   or by starting pgAdmin 4:\n\n   ```bash\n   (venv) $ python3 $PGADMIN4_SRC/web/pgAdmin4.py\n   ```\n\nWhilst it is possible to automatically run setup in desktop mode by running\nthe runtime, that will not work in server mode as the runtime doesn't allow\ncommand line interaction with the setup program.\n\nAt this point you will be able to run pgAdmin 4 from the command line in either\nserver or desktop mode, and access it from a web browser using the URL shown in\nthe terminal once pgAdmin has started up.\n\nSetup of an environment on Windows is somewhat more complicated unfortunately,\nplease see *pkg/win32/README.txt* for complete details.\n\n# Building the documentation\n\nIn order to build the docs, an additional Python package is required in the\nvirtual environment. This can be installed with the pip package manager:\n\n```bash\n$ source venv/bin/activate\n(venv) $ pip install Sphinx\n(venv) $ pip install sphinxcontrib-youtube\n```\n\nThe docs can then be built using the Makefile in *$PGADMIN4_SRC*, e.g.\n\n```bash\n(venv) $ make docs\n```\n\nThe output can be found in *$PGADMIN4_SRC/docs/en_US/_build/html/index.html*\n\n## Building the Runtime\nChange into the runtime directory, and run *yarn install*. This will install the\ndependencies required.\n\nIn order to use the runtime in a development environment, you'll need to copy\n*dev_config.json.in* file to *dev_config.json*, and edit the paths to the Python\nexecutable and *pgAdmin.py* file, otherwise the runtime will use the default\npaths it would expect to find in the standard package for your platform.\n\nYou can then execute the runtime by running something like:\n\n```bash\nyarn run start\n```\n\n# Building packages\n\nMost packages can be built using the Makefile in $PGADMIN4_SRC, provided all\nthe setup and configuration above has been completed.\n\nTo build a source tarball:\n\n```bash\n(venv) $ make src\n```\n\nTo build a PIP Wheel, activate either a Python 3 virtual environment, configured\nwith all the required packages, and then run:\n\n```bash\n(venv) $ make pip\n```\n\nTo build the macOS AppBundle, please see *pkg/mac/README*.\n\nTo build the Windows installer, please see *pkg/win32/README.txt*.\n# Create Database Migrations\n\nIn order to make changes to the SQLite DB, navigate to the 'web' directory:\n\n```bash\n(venv) $ cd $PGADMIN4_SRC/web\n```\n\nCreate a migration file with the following command:\n\n```bash\n(venv) $ FLASK_APP=pgAdmin4.py flask db revision\n```\n\nThis will create a file in: $PGADMIN4_SRC/web/migrations/versions/ .\nAdd any changes to the 'upgrade' function.\nIncrement the SCHEMA_VERSION in $PGADMIN4_SRC/web/pgadmin/model/__init__.py file.\n\nThere is no need to increment the SETTINGS_SCHEMA_VERSION.\n\n# Support\n\nSee https://www.pgadmin.org/support/ for support options.\n\n# Security Issues\n\nIf you would like to report a security issue with pgAdmin, please email\n**security (at) pgadmin (dot) org**.\n\nNote that this address should only be used for reporting security issues\nthat you believe you've found in the design or code of pgAdmin, pgAgent,\nand the pgAdmin website. It should not be used to ask security questions.\n\n# Project info\n\nA GitHub project for pgAdmin 4 can be found at the address below:\n\nhttps://github.com/pgadmin-org/pgadmin4\n\nPlease submit any changes as Pull Requests against the *master* branch of the\n*pgadmin-org/pgadmin4* repository.\n\nIf you wish to discuss pgAdmin 4, or contribute to the project, please use the\npgAdmin Hackers mailing list:\n\npgadmin-hackers@postgresql.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgadmin-org%2Fpgadmin4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgadmin-org%2Fpgadmin4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgadmin-org%2Fpgadmin4/lists"}