{"id":51416898,"url":"https://github.com/gnufood/psql-scip","last_synced_at":"2026-07-04T20:01:26.041Z","repository":{"id":351683416,"uuid":"1208864500","full_name":"gnufood/psql-scip","owner":"gnufood","description":"SCIP indexer for PostgreSQL","archived":false,"fork":false,"pushed_at":"2026-04-12T23:47:40.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-13T07:13:48.142Z","etag":null,"topics":["code-intelligence","postgresql","rust","scip"],"latest_commit_sha":null,"homepage":"https://releases.gnu.foo","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnufood.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-12T20:56:23.000Z","updated_at":"2026-04-13T08:22:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gnufood/psql-scip","commit_stats":null,"previous_names":["gnufood/psql-scip"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gnufood/psql-scip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnufood%2Fpsql-scip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnufood%2Fpsql-scip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnufood%2Fpsql-scip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnufood%2Fpsql-scip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnufood","download_url":"https://codeload.github.com/gnufood/psql-scip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnufood%2Fpsql-scip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35133834,"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-07-04T02:00:05.987Z","response_time":113,"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":["code-intelligence","postgresql","rust","scip"],"created_at":"2026-07-04T20:01:25.247Z","updated_at":"2026-07-04T20:01:26.019Z","avatar_url":"https://github.com/gnufood.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# psql-scip\n\n[![CI](https://github.com/gnufood/psql-scip/actions/workflows/ci.yml/badge.svg)](https://github.com/gnufood/psql-scip/actions/workflows/ci.yml)\n[![rustc 1.88+](https://img.shields.io/badge/rustc-1.88+-orange?logo=rust)](https://www.rust-lang.org)\n\nSCIP indexer for PostgreSQL. Produces an `index.scip` from a `pg_dump` schema\nand a directory of `.sql` files.\n\n## Install\n\n**Pre-built binaries** (Linux x86_64 and aarch64, gnu and musl)\n\n```bash\ncurl -LsSf https://releases.gnu.foo/psql-scip/latest/install.sh | sh\n```\n\n[inspect install.sh](https://releases.gnu.foo/psql-scip/latest/install.sh)\n\n**From crates.io**\n\n```bash\ncargo install psql-scip\n```\n\n**Build from source**\n\n```bash\ngit clone https://github.com/gnufood/psql-scip\ncd psql-scip\ncargo build --release\n# binary at target/release/psql-scip\n```\n\nRequires Rust 1.88 or later.\n\n## Usage\n\n```bash\npsql-scip -s \u003cFILE\u003e -r \u003cDIR\u003e [OPTIONS]\n```\n\n| Flag | Short | Default | Description |\n|---|---|---|---|\n| `--schema \u003cFILE\u003e` | `-s` | required | `pg_dump --schema-only` output |\n| `--root \u003cDIR\u003e` | `-r` | required | directory of `.sql` files to index |\n| `--out \u003cFILE\u003e` | `-o` | `index.scip` | output path for the SCIP index |\n| `--log-level` | `-l` | `warn` | `error` / `warn` / `info` / `debug` / `trace` |\n| `--no-gitignore` | `-n` | false | index files excluded by `.gitignore` |\n\n`RUST_LOG` env var overrides `--log-level`. Exit codes: `0` success, `1` fatal error.\n\n## Example\n\n```bash\npg_dump --schema-only mydb \u003e schema.sql\n\npsql-scip \\\n  --schema schema.sql \\\n  --root   ./db \\\n  --out    index.scip\n```\n\nOutput:\n\n```text\ntables=12 functions=34 views=4 types=7 ... schema loaded\ncount=50 sql files discovered\nfiles=50 occurrences=529 indexing complete\n```\n\nThe resulting `index.scip` can be used with any SCIP-compatible tool —\n[Sourcegraph](https://sourcegraph.com), [`scip` CLI](https://github.com/sourcegraph/scip), etc.\n\n## What gets indexed\n\n### Definitions (`SymbolInformation`)\n\nExtracted from the schema file. Each definition produces a symbol with a kind,\na one-line SQL signature, optional `COMMENT ON` documentation, and an\n`enclosing_symbol` for nested constructs (columns inside tables, fields inside\ncomposite types).\n\n| Construct | SCIP kind | Symbol format |\n|---|---|---|\n| Table | `Struct` | `pgscip . . . public/users.` |\n| Column | `Field` | `pgscip . . . public/users#id.` |\n| Composite type field | `Field` | `pgscip . . . public/address#street.` |\n| Function | `Function` | `pgscip . . . public/find_item().` |\n| View | `Class` | `pgscip . . . public/users_view.` |\n| Enum type | `Enum` | `pgscip . . . public/status#` |\n| Composite type | `Struct` | `pgscip . . . public/point_2d#` |\n| Trigger | `Event` | `pgscip . . . public/trg_audit.` |\n| Policy | `Attribute` | `pgscip . . . public/rls_policy.` |\n| Index | `Property` | `pgscip . . . public/users_idx.` |\n\nSignatures carry inner occurrences where applicable — a function's return type\nand a column's type are clickable hyperlinks when that type is a user-defined\ntype in the schema.\n\n### Relationships\n\nCross-references encoded directly in `SymbolInformation.relationships`:\n\n| Symbol | Relationship |\n|---|---|\n| Column with user-defined type | `is_type_definition` → the type |\n| Column with FK | `is_reference + is_type_definition` → the referenced column |\n| Function | `is_type_definition` → return type and each param type (user-defined only) |\n| View | `is_reference` → each source table / view |\n| Trigger | `is_reference` → target table and `EXECUTE FUNCTION` target |\n| Index | `is_reference` → target table |\n| Policy | `is_reference` → target table |\n\n### References (`Occurrence`)\n\nResolved across all `.sql` files under `--root`. Each occurrence carries the\nreference range, the enclosing statement range, and a back-reference to the\ndefining symbol.\n\n| Construct | Location method |\n|---|---|\n| Table reference | AST `RangeVar` |\n| Column reference | AST `ColumnRef` |\n| Function call | AST `FuncCall` |\n| Type usage | AST `TypeCast` / `TypeName` |\n| Index columns | Lexer — AST carries no position for `ON (col_a, col_b)` |\n| FK columns (both sides) | Lexer — AST carries no position for `FOREIGN KEY (col)` / `REFERENCES t(col)` |\n| Trigger function | Lexer — AST carries no position after `EXECUTE FUNCTION` |\n\nParse failures produce diagnostic occurrences with the parser error message\nattached, visible as inline errors in supporting editors.\n\n### Not indexed\n\n`DROP` and `ALTER ... RENAME` statements are not yet handled — the schema model\nis forward-only. This is not a limitation when using a `pg_dump --schema-only`\noutput (which never contains destructive DDL). Migration stacking support is\nplanned.\n\n## Dev\n\n```bash\ngit clone https://github.com/gnufood/psql-scip\ncd psql-scip\njust ci   # format-check, lint, test, audit, msrv\n```\n\nRequires `cargo-audit` and `cargo-msrv` in addition to Rust 1.88 or later:\n\n```bash\ncargo install cargo-audit --locked\ncargo install cargo-msrv --locked\n```\n\n## Bug reports\n\n[Open an issue](https://github.com/gnufood/psql-scip/issues).\n\n## Acknowledgements\n\nBuilt on the work of the [Postgres Language Server](https://github.com/supabase-community/postgres-language-server) team, whose crates informed the early design of this project.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnufood%2Fpsql-scip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnufood%2Fpsql-scip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnufood%2Fpsql-scip/lists"}