{"id":50344578,"url":"https://github.com/timescale/ghostgres","last_synced_at":"2026-05-29T19:01:45.486Z","repository":{"id":348386077,"uuid":"1192887242","full_name":"timescale/ghostgres","owner":"timescale","description":"There are no dumb queries, only dumb databases","archived":false,"fork":false,"pushed_at":"2026-04-23T00:31:24.000Z","size":105,"stargazers_count":39,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T14:46:16.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ghostgres.com","language":"Go","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/timescale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-26T16:55:50.000Z","updated_at":"2026-05-22T08:06:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/timescale/ghostgres","commit_stats":null,"previous_names":["timescale/ghostgres"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timescale/ghostgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fghostgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fghostgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fghostgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fghostgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timescale","download_url":"https://codeload.github.com/timescale/ghostgres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fghostgres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33666290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-05-29T19:01:44.562Z","updated_at":"2026-05-29T19:01:45.480Z","avatar_url":"https://github.com/timescale.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ghostgres\n\nAre you tired of maintaining your relational database? Tired of having to write \"syntactically correct\" SQL queries? Tired of having queries fail because tables \"don't exist\"?\n\nLook no further. [Ghostgres](https://ghostgres.com) is the database of the future. There's nothing to maintain. No query language. It doesn't return errors. The only limits on what you can query are the limits of your imagination.\n\nThe best part? It's Postgres wire-compatible, so you can plug it in wherever you use Postgres.\n\nJust grab an API key for your favorite model provider and connect:\n\n```bash\npsql \"postgres://openai:\u003cOPENAI_API_KEY\u003e@try.ghostgres.com/gpt-5.4\"\n```\n\nThen start querying:\n\n```\ngpt-5.4=\u003e What is the best database?;\n```\n\nJust remember to end your queries with a semicolon (`;`).\n\nOh, and be careful with single (`'`) and double quotes (`\"`).\n\n**Built with \u003c3 by [Ghost](https://ghost.build).**\n\n## Connecting\n\nConnect using `psql` or any Postgres client. The username is the LLM provider (`openai` or `anthropic`), the password is your API key, and the database is the model name.\n\n```bash\npsql \"postgres://\u003cprovider\u003e:\u003capi_key\u003e@try.ghostgres.com/\u003cmodel\u003e\"\n```\n\n## Running Locally\n\nYou can run the Ghostgres server locally with:\n\n```bash\ngo run github.com/timescale/ghostgres/cmd/ghostgres@latest\n```\n\nThen connect to localhost:\n\n```bash\npsql \"postgres://openai:\u003cOPENAI_API_KEY\u003e@localhost/gpt-5.4\"\n```\n\n### Flags:\n\nThe server accepts the following flags:\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `-host` | `\"\"` (all interfaces) | Hostname/interface to bind to |\n| `-port` | `5432` | Port to listen on |\n| `-log-level` | `info` | Log level (`debug`, `info`, `warn`, `error`) |\n| `-prompt` | Built-in prompt | Path to a file containing a custom system prompt |\n| `-tls-cert` | (disabled) | Path to TLS certificate PEM file (requires `-tls-key`) |\n| `-tls-key` | (disabled) | Path to TLS private key PEM file (requires `-tls-cert`) |\n\n## Supported providers\n\n### OpenAI\n\nUsername: `openai`.\nPassword: your [OpenAI API key](https://platform.openai.com/api-keys).\nDatabase: any OpenAI model name (e.g. `gpt-5.4`, `gpt-4o`, `o3`).\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `reasoning_effort` | Reasoning effort level (e.g. `none`, `minimal`, `low`, `medium`, `high`). Valid values depend on the model. | Lowest supported for the model |\n\n### Anthropic\n\nUsername: `anthropic`.\nPassword: your [Anthropic API key](https://platform.claude.com/settings/keys).\nDatabase: any Anthropic model name (e.g. `claude-sonnet-4-6`, `claude-opus-4-6`).\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `effort` | Output effort level (`low`, `medium`, `high`, `max`) | `low` |\n| `thinking` | Extended thinking budget in tokens (minimum 1024) | Disabled |\n\n### Setting options\n\nOptions are passed via the `options` connection parameter (`PGOPTIONS` env var or `options=` in the connection string). Multiple options are space-separated.\n\n```bash\npsql \"postgres://openai:sk-...@localhost/gpt-5.4?options=reasoning_effort%3Dhigh\"\n\n# Or:\n\nPGOPTIONS=\"reasoning_effort=high\" psql \"postgres://openai:sk-...@localhost/gpt-5.4\"\n```\n\n## How it works\n\nEach client connection gets its own LLM chat session. The server translates Postgres wire protocol messages into LLM API calls and converts the structured JSON responses back into proper Postgres result sets. Chat history is maintained per connection, so the LLM can stay consistent across queries within a session.\n\n## SSL/TLS\n\nGhostgres supports optional SSL/TLS encryption via the PostgreSQL wire protocol's `SSLRequest` handshake. When enabled, clients that request SSL (e.g. `sslmode=require`) will have their connections upgraded to TLS before any credentials are sent.\n\nTo enable TLS, provide a certificate and private key:\n\n```bash\nghostgres -tls-cert /path/to/cert.pem -tls-key /path/to/key.pem\n```\n\nWhen TLS is not enabled, SSL requests from clients are denied and the connection continues in plaintext. Clients using `sslmode=prefer` (the default for most Postgres clients) will fall back to an unencrypted connection automatically.\n\n## Security note\n\nAuthentication uses cleartext passwords because the server needs the raw API key to call the LLM provider. When running remotely, enable TLS (see above) to encrypt the connection. Without TLS, connect over localhost or use SSH tunneling.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Fghostgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimescale%2Fghostgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Fghostgres/lists"}