{"id":51013108,"url":"https://github.com/ilbertt/better-auth-bun-sql","last_synced_at":"2026-06-21T06:02:23.703Z","repository":{"id":365035679,"uuid":"1270242590","full_name":"ilbertt/better-auth-bun-sql","owner":"ilbertt","description":"A better-auth database adapter for Bun's built-in SQL module","archived":false,"fork":false,"pushed_at":"2026-06-15T16:06:46.000Z","size":30,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-15T16:26:12.335Z","etag":null,"topics":["better-auth","bun","sql","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilbertt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-15T14:19:51.000Z","updated_at":"2026-06-15T14:54:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ilbertt/better-auth-bun-sql","commit_stats":null,"previous_names":["ilbertt/better-auth-bun-sql"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ilbertt/better-auth-bun-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilbertt%2Fbetter-auth-bun-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilbertt%2Fbetter-auth-bun-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilbertt%2Fbetter-auth-bun-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilbertt%2Fbetter-auth-bun-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilbertt","download_url":"https://codeload.github.com/ilbertt/better-auth-bun-sql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilbertt%2Fbetter-auth-bun-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34596047,"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-06-21T02:00:05.568Z","response_time":54,"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":["better-auth","bun","sql","typescript"],"created_at":"2026-06-21T06:02:22.523Z","updated_at":"2026-06-21T06:02:23.694Z","avatar_url":"https://github.com/ilbertt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @ilbertt/better-auth-bun-sql\n\nA [better-auth](https://better-auth.com) database adapter for Bun's built-in SQL module ([`bun:sql`](https://bun.com/docs/runtime/sql)).\n\n## Installation\n\n```sh\nbun add @ilbertt/better-auth-bun-sql\n```\n\n\u003e Requires [Bun](https://bun.com) — this adapter relies on the `bun:sql` runtime module and does not work on Node.js.\n\n## Usage\n\nPass a `bun:sql` instance — connected to Postgres or SQLite — to `bunSqlAdapter`:\n\n```ts\nimport { betterAuth } from 'better-auth';\nimport { SQL } from 'bun';\nimport { bunSqlAdapter } from '@ilbertt/better-auth-bun-sql';\n\nconst sql = new SQL(process.env.DATABASE_URL); // e.g. postgres://… or sqlite://…\n\nexport const auth = betterAuth({\n  database: bunSqlAdapter({ sql }),\n});\n```\n\n### Options\n\n| Option      | Type                      | Default           | Description                                                                                                                                     |\n| ----------- | ------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |\n| `sql`       | `SQL`                     | -       | **Required.** A `bun:sql` instance connected to a Postgres or SQLite database.                                                                 |\n| `schema`    | `string`                  | -       | Database schema (namespace) the tables live in. When omitted, table names are unqualified and resolved against the connection's `search_path`. |\n| `usePlural` | `boolean`                 | `false` | Pluralize table names (`user` → `users`).                                                                                                     |\n| `debugLogs` | `DBAdapterDebugLogOption` | `false` | better-auth adapter debug logging.                                                                                                            |\n\n## Supported databases\n\n`bun:sql` speaks Postgres, SQLite, and MySQL/MariaDB, but this adapter supports **Postgres and SQLite only**. MySQL/MariaDB lack the `RETURNING` clause the adapter relies on for `create`/`update`, so they are intentionally unsupported (the adapter throws on a MySQL/MariaDB connection). The dialect is detected automatically from the `bun:sql` instance.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./.github/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filbertt%2Fbetter-auth-bun-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filbertt%2Fbetter-auth-bun-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filbertt%2Fbetter-auth-bun-sql/lists"}