Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries

License

NotificationsYou must be signed in to change notification settings

supabase/postgres-meta

Repository files navigation

A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries (and more).

Documentation

https://supabase.github.io/postgres-meta/

Progress

Schema:

  • POST /query (Execute SQL query)
    • POST /format (Format SQL query)
    • POST /parse (Parse SQL query into AST)
    • POST /explain (Explain SQL query)
  • /columns
    • GET (List)
    • POST (alter table add column)
    • PATCH (alter table alter/rename column)
    • DELETE (alter table drop column)
  • /extensions
    • GET (List)
    • POST (create extension)
    • PATCH (alter extension)
    • DELETE (drop extension)
  • /functions
    • GET (List)
    • POST (create function)
    • PATCH (alter function)
    • DELETE (drop function)
  • /publications
    • GET (List)
    • POST (create publication)
    • PATCH (alter publication)
    • DELETE (drop publication)
  • /roles
    • GET (List)
    • POST (create role)
    • PATCH (alter role)
    • DELETE (drop role)
  • /schemas
    • GET (List)
    • POST (create schema)
    • PATCH (alter schema)
    • DELETE (drop schema)
  • /tables
    • GET (List)
    • POST (create table)
    • PATCH (alter table)
    • DELETE (drop table)
  • /triggers
    • GET (List)
    • POST (create trigger)
    • PATCH (alter trigger)
    • DELETE (drop trigger)
  • /types
    • GET (List)
    • POST (create type)
    • PATCH (alter type)
    • DELETE (drop type)

Helpers:

  • /config
    • GET/version: Postgres version
  • /generators
    • GET/openapi: Generate Open API
    • GET/typescript: Generate Typescript types
    • GET/swift: Generate Swift types (beta)

Quickstart

Set the following ENV VARS:

PG_META_HOST="0.0.0.0"PG_META_PORT=8080PG_META_DB_HOST="postgres"PG_META_DB_NAME="postgres"PG_META_DB_USER="postgres"PG_META_DB_PORT=5432PG_META_DB_PASSWORD="postgres"

Then run any of the binaries in the releases.

FAQs

Why?

This serves as a light-weight connection pooler. It also normalises the Postgres system catalog into a more readable format. While there is a lot of re-inventing right now, this server will eventually provide helpers (such as type generators). The server is multi-tenant, so it can support multiple Postgres databases from a single server.

What security does this use?

None. Please don't use this as a standalone server. This should be used behind a proxy in a trusted environment, on your local machine, or using this internally with no access to the outside world.

Developers

To start developing, runnpm run dev. It will set up the database with Docker for you. The server will restart on file change.

If you are fixing a bug, you should create a new test case. To test your changes, add the-u flag tovitest on thetest:run script, runnpm run test, and then review the git diff of the snapshots. Depending on your change, you may seeid fields being changed - this is expected and you are free to commit it, as long as it passes the CI. Don't forget to remove the-u flag when committing.

To make changes to the type generation, runnpm run gen:types:<lang> while you havenpm run dev running,where<lang> is one of:

  • typescript
  • go
  • swift (beta)

To use your own database connection string instead of the provided test database, run:PG_META_DB_URL=postgresql://postgres:postgres@localhost:5432/postgres npm run gen:types:<lang>

Licence

Apache 2.0

About

A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors49

Languages


[8]ページ先頭

©2009-2025 Movatter.jp