{"id":16957905,"url":"https://github.com/joshnuss/requel","last_synced_at":"2025-07-01T07:04:59.103Z","repository":{"id":248762118,"uuid":"829636780","full_name":"joshnuss/requel","owner":"joshnuss","description":"Import SQL files with Vite","archived":false,"fork":false,"pushed_at":"2024-07-20T04:23:56.000Z","size":269,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T07:03:52.955Z","etag":null,"topics":["postgres","sql","typescript","vite"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshnuss.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}},"created_at":"2024-07-16T20:48:41.000Z","updated_at":"2024-07-20T04:23:59.000Z","dependencies_parsed_at":"2025-02-20T04:42:19.229Z","dependency_job_id":null,"html_url":"https://github.com/joshnuss/requel","commit_stats":null,"previous_names":["joshnuss/requel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joshnuss/requel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Frequel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Frequel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Frequel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Frequel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshnuss","download_url":"https://codeload.github.com/joshnuss/requel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Frequel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262916618,"owners_count":23383885,"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":["postgres","sql","typescript","vite"],"created_at":"2024-10-13T22:20:28.238Z","updated_at":"2025-07-01T07:04:59.045Z","avatar_url":"https://github.com/joshnuss.png","language":"TypeScript","readme":"# Requel\n\nType-safe `.sql` files with Vite.\n\n## Usage\n\nAdd the plugin in `vite.config.ts`\n\n```ts\nimport { defineConfig } from 'vite'\nimport { requel } from 'vite-plugin-requel'\n\nexport default defineConfig({\n  plugins: [ requel() ]\n})\n```\n\nAdd `DATABASE_URL` to the `.env` file.\n\nThen, initialize the repo:\n\n```bash\npnpx requel init\n```\n\nPull the database schema:\n\n```bash\npnpx requel db pull\n```\n\nCreate a `.sql` file, for example `db/products.sql`.\n\n**Note**: input params can be typed via front matter\n\n```sql\n---\nminPrice: integer\n---\n\nselect *\n  from products\n  where price \u003e :minPrice\n```\n\nImport the `.sql` file:\n\n```ts\nimport { query } from '$db/products.sql'\n\n// input params and output rows are full typed\nconst rows = await query({ minPrice: 100 })\n```\n\n## Related projects\n\n- [Drizzle](https://orm.drizzle.team)\n- [Prisma](https://www.prisma.io)\n- [Kysely](https://kysely.dev)\n- [TypeSQL](https://github.com/wsporto/typesql)\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshnuss%2Frequel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshnuss%2Frequel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshnuss%2Frequel/lists"}