{"id":51591773,"url":"https://github.com/stevenliebregt/gieter","last_synced_at":"2026-07-15T19:01:09.024Z","repository":{"id":370749858,"uuid":"1296109684","full_name":"stevenliebregt/gieter","owner":"stevenliebregt","description":"Pour your database schema in, get typed code out! A pluggable code generator that's extensible with custom sources and emitters.","archived":false,"fork":false,"pushed_at":"2026-07-11T14:41:05.000Z","size":217,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-11T15:15:53.138Z","etag":null,"topics":["cli","code-generation","codegen","database-schema","developer-tools","introspection","postgres","postgresql","rust","schema","type-safety","typescript"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/gieter","language":"Rust","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/stevenliebregt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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-07-10T05:59:52.000Z","updated_at":"2026-07-11T14:41:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stevenliebregt/gieter","commit_stats":null,"previous_names":["stevenliebregt/gieter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stevenliebregt/gieter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenliebregt%2Fgieter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenliebregt%2Fgieter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenliebregt%2Fgieter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenliebregt%2Fgieter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenliebregt","download_url":"https://codeload.github.com/stevenliebregt/gieter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenliebregt%2Fgieter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35395749,"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-12T02:00:06.386Z","response_time":87,"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":["cli","code-generation","codegen","database-schema","developer-tools","introspection","postgres","postgresql","rust","schema","type-safety","typescript"],"created_at":"2026-07-11T15:02:10.846Z","updated_at":"2026-07-12T16:01:02.332Z","avatar_url":"https://github.com/stevenliebregt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/stevenliebregt/gieter/HEAD/assets/gieter-logo.svg\" alt=\"gieter\" width=\"140\" height=\"140\"\u003e\n\n  \u003ch1\u003egieter\u003c/h1\u003e\n\n  \u003cp\u003e\u003cem\u003ePour your database schema in, get typed code out.\u003c/em\u003e\u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://crates.io/crates/gieter\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/gieter.svg\" alt=\"crates.io\"\u003e\u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg\" alt=\"license\"\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n**gieter** (Dutch for *watering can*) introspects a live database and emits typed source code from it. It reads your schema, tables, columns, enums, keys, etc. and turns it into a neutral intermediate representation, then hands that to pluggable **emitters** to generate code in the language of your choice.\n\nToday it ships a PostgreSQL source and a TypeScript emitter.\n\n## Features\n\n- **Live introspection** of PostgreSQL schemas (tables, columns, enums, primary \u0026 foreign keys, comments).\n- **Typed TypeScript output** with configurable `type`/`interface`, enum, casing, and null styles.\n- **Branded ID types**; nominal types for primary/foreign keys so a `UserId` can't be passed where a `PostId` belongs.\n- **Scalar type overrides** with automatic import hoisting.\n- **Flexible file layout**; split kinds across files or emit everything into one.\n- **Extensible by design**; sources and emitters are just crates implementing a `gieter_core` trait.\n- **Language-agnostic plugins**; an external process can act as a source or emitter by exchanging the schema IR as JSON over stdin/stdout, so a plugin can be written in any language.\n\n## Missing features\n\nThings that are currently not supported by **gieter** but are planned are:\n\n- **Python emitter**.\n- **Zod emitter**.\n- **Rust emitter**.\n\n## Install\n\n```sh\ncargo install gieter\n```\n\nOr build from source:\n\n```sh\ngit clone https://github.com/stevenliebregt/gieter\ncd gieter\ncargo install --path crates/gieter\n```\n\n## Quick start\n\nCreate a `gieter.toml`:\n\n```toml\n[source]\ntype = \"postgres\"\nurl = \"postgres://user:password@localhost:5432/db\"\nschemas = [\"public\"]\n\n[[emitter]]\ntype = \"typescript\"\nout_dir = \"src/db\"\noutput = \"schema.ts\"\n```\n\nThen run:\n\n```sh\ngieter # uses ./gieter.toml\ngieter --config path/to/gieter.toml\n```\n\nThe database URL may be read from the environment with `url = \"env:DATABASE_URL\"`.\nSee [`examples/`](crates/emitters/gieter_typescript/examples) for a fully-annotated config.\n\n## Extending gieter\n\nThere are two ways to add a source or emitter: in-process in Rust, or an external process in any language.\n\n### In-process (Rust)\n\nEverything hangs off [`gieter_core`](crates/gieter_core), which defines the schema IR plus the `Source` and `Emitter` traits. Depend on it, implement the trait, and register a factory in your own binary alongside the built-ins:\n\n```toml\n[dependencies]\ngieter_core = \"\u003cversion\u003e\"\n```\n\n```rust\nlet mut sources = SourceRegistry::default();\nsources.register(\"my-db\", my_crate::factory);\n```\n\n### External process (any language)\n\nAn external process can be a source or emitter without any Rust. gieter runs the command you configure and exchanges the schema IR as JSON over the process's stdin and stdout, so the plugin can be written in Python, Node, Go, or anything that reads stdin and writes stdout. The `command` is an argv array, so it works the same across platforms.\n\n```toml\n[source]\ntype = \"external\"\ncommand = [\"python3\", \"introspect.py\"]\nschemas = [\"public\"]\n\n[[emitter]]\ntype = \"external\"\ncommand = [\"node\", \"emit.js\"]\nout_dir = \"generated\"\n```\n\n- A **source** receives a `SourceRequest` (`{ ir_version, schemas, options }`) on stdin and writes a `SourceResponse` (`{ ir_version, catalog }`) to stdout.\n- An **emitter** receives an `EmitRequest` (`{ ir_version, catalog, options }`) and writes an `EmitResponse` (`{ ir_version, files, warnings }`).\n\nEvery key in the config block except the transport keys `command` and `timeout` is forwarded to the plugin as its `options`. A plugin that runs longer than `timeout` seconds (default 120) is stopped with an error. Print the exact JSON Schema for any message so you can generate types for your plugin:\n\n_See the `examples/external/markdown-emitter` example which has both an external source and an external emitter._\n\n```sh\ngieter schema source-request\ngieter schema emit-response\n```\n\nThe `ir_version` field guards the contract: if a plugin speaks a version gieter does not expect, gieter stops with a clear message instead of misreading the data.\n\n## License\n\nLicensed under either of [MIT](LICENSE-MIT) or [Apache-2.0](LICENSE-APACHE) at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenliebregt%2Fgieter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenliebregt%2Fgieter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenliebregt%2Fgieter/lists"}