{"id":13467911,"url":"https://github.com/supabase/dbdev","last_synced_at":"2026-04-22T13:07:49.957Z","repository":{"id":41769776,"uuid":"449055451","full_name":"supabase/dbdev","owner":"supabase","description":"Database Package Registry for Postgres","archived":false,"fork":false,"pushed_at":"2025-05-12T09:19:19.000Z","size":4494,"stargazers_count":400,"open_issues_count":20,"forks_count":24,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-12T09:54:21.999Z","etag":null,"topics":["extensions","postgres","postgresql"],"latest_commit_sha":null,"homepage":"https://database.dev/","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/supabase.png","metadata":{"funding":{"github":["supabase"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null},"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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-17T21:35:49.000Z","updated_at":"2025-05-12T09:19:21.000Z","dependencies_parsed_at":"2024-04-15T04:24:02.126Z","dependency_job_id":"4eaf02a5-1af0-447d-92c3-bea0d05af9fa","html_url":"https://github.com/supabase/dbdev","commit_stats":{"total_commits":466,"total_committers":15,"mean_commits":"31.066666666666666","dds":0.4484978540772532,"last_synced_commit":"61f4a6eb1550a3c1ed274e8c1f291fca71f9a063"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fdbdev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fdbdev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fdbdev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fdbdev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supabase","download_url":"https://codeload.github.com/supabase/dbdev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253807467,"owners_count":21967369,"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":["extensions","postgres","postgresql"],"created_at":"2024-07-31T15:01:02.419Z","updated_at":"2025-10-03T20:46:36.875Z","avatar_url":"https://github.com/supabase.png","language":"PLpgSQL","funding_links":["https://github.com/sponsors/supabase"],"categories":["PLpgSQL","TypeScript"],"sub_categories":[],"readme":"![dbdev](/assets/dbdev-banner.jpg)\n\n# dbdev\n\ndbdev is a package manager for Postgres [trusted language extensions (TLE)](https://github.com/aws/pg_tle).\n\n- Search for packages on [database.dev](https://database.dev).\n- Documentation: [supabase.github.io/dbdev/](https://supabase.github.io/dbdev/)\n- Publish your own Extension: [supabase.github.io/dbdev/publish-extension/](https://supabase.github.io/dbdev/publish-extension/)\n- Read the dbdev [release blog post](https://supabase.com/blog/dbdev)\n\n### Warning\n\nRestoring a logical backup of a database with a TLE installed can fail. For this reason, dbdev should only be used with databases with physical backups enabled.\n\n## Usage\n\nUsers primarily interact with the registry using the dbdev SQL client. Once present, packages can be installed as follows:\n\n```sql\n-- Load the package from the package index\nselect dbdev.install('olirice-index_advisor');\n```\nWhere `olirice` is the handle of the publisher and `index_advisor` is the name of the package.\n\nOnce installed, packages are visible in PostgreSQL as extensions. At that point they can be enabled with standard Postgres commands i.e. the `create extension`\n\nTo improve reproducibility, we recommend __always__ specifying the package version in your `create extension` statements.\n\nFor example:\n```sql\n-- Enable the extension\ncreate extension \"olirice-index_advisor\"\n    version '0.1.0';\n```\n\nWhich creates all tables/indexes/functions/etc specified by the extension.\n\n## Install the Client in Postgres\n\nThe in-database SQL client for the package registry is named `dbdev`. You can bootstrap the client with:\n\n```sql\n/*---------------------\n---- install dbdev ----\n----------------------\nRequires:\n  - pg_tle: https://github.com/aws/pg_tle\n  - pgsql-http: https://github.com/pramsey/pgsql-http\n*/\ncreate extension if not exists http with schema extensions;\ncreate extension if not exists pg_tle;\ndrop extension if exists \"supabase-dbdev\";\nselect pgtle.uninstall_extension_if_exists('supabase-dbdev');\nselect\n    pgtle.install_extension(\n        'supabase-dbdev',\n        resp.contents -\u003e\u003e 'version',\n        'PostgreSQL package manager',\n        resp.contents -\u003e\u003e 'sql'\n    )\nfrom http(\n    (\n        'GET',\n        'https://api.database.dev/rest/v1/'\n        || 'package_versions?select=sql,version'\n        || '\u0026package_name=eq.supabase-dbdev'\n        || '\u0026order=version.desc'\n        || '\u0026limit=1',\n        array[\n            ('apiKey', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhtdXB0cHBsZnZpaWZyYndtbXR2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODAxMDczNzIsImV4cCI6MTk5NTY4MzM3Mn0.z2CN0mvO2No8wSi46Gw59DFGCTJrzM0AQKsu_5k134s')::http_header\n        ],\n        null,\n        null\n    )\n) x,\nlateral (\n    select\n        ((row_to_json(x) -\u003e 'content') #\u003e\u003e '{}')::json -\u003e 0\n) resp(contents);\ncreate extension \"supabase-dbdev\";\nselect dbdev.install('supabase-dbdev');\ndrop extension if exists \"supabase-dbdev\";\ncreate extension \"supabase-dbdev\";\n```\n\nWith the client ready, search for packages on [database.dev](database.dev) and install them\n```sql\nselect dbdev.install('handle-package_name');\ncreate extension \"handle-package_name\"\n    schema 'public'\n    version '1.2.3';\n```\n\n## Developers\n\nThe [`supabase/dbdev`](https://github.com/supabase/dbdev) repository hosts the source code for both the database.dev package registry and its accompanying website. It also hosts the work-in-progress CLI for authors manage their packages.\n\n### Package Registry\n\nThe package registry `supabase/`, is a [Supabase](https://supabase.com) project where accounts, organizations, and packages are normalized into database tables. For more info of the registry, see the [architecture](#architecture) section\n\nRequires:\n- [Supabase CLI](https://github.com/supabase/cli)\n- [docker](https://www.docker.com/)\n\n```\nsupabase start\n```\n\nwhich returns a set of endpoints for each service\n\n```text\nsupabase local development setup is running.\n\n         API URL: http://localhost:54321\n     GraphQL URL: http://localhost:54321/graphql/v1\n          DB URL: postgresql://postgres:postgres@localhost:54322/postgres\n      Studio URL: http://localhost:54323\n    Inbucket URL: http://localhost:54324\n      JWT secret: SECRET\n        anon key: KEY\nservice_role key: KEY\n```\n\nThe *API URL* and *anon key* values will be used in the next section to setup environment variables.\n\n\n### Website (database.dev)\n\nThe website/ directory contains a Next.js project, which serves as the visual interface for users to interact with the registry.\n\nRequires:\n- [node 14+](https://nodejs.org/en)\n\nCopy `.env.example` file to `.env.local`:\n\n```\ncp .env.example .env.local\n```\n\nEdit the `.env.local` file with your favourite text editor to set the environment variables `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY`:\n\n```\nNEXT_PUBLIC_SUPABASE_URL=\"\u003cValue of API URL\u003e\"\nNEXT_PUBLIC_SUPABASE_ANON_KEY=\"\u003cValue of anon key\u003e\"\n```\n\nStart the development environment:\n\n```\ncd website\nnpm install\nnpm run dev\n```\n\nNavigate to [http://localhost:3000](http://localhost:3000)\n\n\n### CLI\n\nComing soon in the `cli/` directory\n\n### Architecture\n\n- The core tables are located in the `app` schema.\n- The public API is located in the `public` schema.\n\n![ERD](assets/erd.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fdbdev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupabase%2Fdbdev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fdbdev/lists"}