cockroachdb / cockroachdb/cockroach

sql: support for Bun ORM

オープン
#93,550 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
C-enhancement T-sql-foundations
主要言語
Go
スター
32.5k
フォーク
4.1k
PR マージ指標
PR 指標を取得中

説明

[Bun](https://github.com/uptrace/bun) is a more frequently updated ORM recommended in place of pg-go should someone need an actively maintained ORM. Looks like most of the tests pass and the unsupported ones could be skipped for now.

Running the Bun tests against CRDB resulted in:
```
❯ ./test.sh
+ trap 'docker-compose down -v' EXIT
+ docker-compose down -v
+ docker-compose up -d
[+] Running 2/2
⠿ Network dbtest_default Created 0.0s
⠿ Container dbtest-postgres-1 Started 0.2s
+ sleep 10
+ CGO_ENABLED=0
+ TZ=
+ go test
--- FAIL: TestListenerReceive (0.22s)
listener_test.go:28:
Error Trace: listener_test.go:28
Error: Received unexpected error:
ERROR: at or near "notify": syntax error (SQLSTATE=42601)
Test: TestListenerReceive
--- FAIL: TestListenerChannel (0.01s)
listener_test.go:66:
Error Trace: listener_test.go:66
Error: Received unexpected error:
ERROR: at or near "notify": syntax error (SQLSTATE=42601)
Test: TestListenerChannel
--- FAIL: TestORM (0.44s)
--- FAIL: TestORM/pg (0.04s)
orm_test.go:586:
Error Trace: orm_test.go:586
orm_test.go:41
db_test.go:94
Error: Received unexpected error:
ERROR: at or near "restart": syntax error (SQLSTATE=42601)
Test: TestORM/pg
--- FAIL: TestORM/pgx (0.40s)
orm_test.go:586:
Error Trace: orm_test.go:586
orm_test.go:41
db_test.go:94
Error: Received unexpected error:
ERROR: at or near "restart": syntax error (SQLSTATE 42601)
Test: TestORM/pgx
--- FAIL: TestPostgresCopyFromCopyTo (0.00s)
pg_test.go:557:
Error Trace: pg_test.go:557
Error: Received unexpected error:
ERROR: temporary tables are only supported experimentally (SQLSTATE=XCEXF)
Test: TestPostgresCopyFromCopyTo
--- FAIL: TestPostgresHStore (0.00s)
pg_test.go:665:
Error Trace: pg_test.go:665
Error: Received unexpected error:
ERROR: unimplemented: extension "hstore" is not yet supported (SQLSTATE=0A000)
Test: TestPostgresHStore
--- FAIL: TestPostgresHStoreQuote (0.01s)
pg_test.go:713:
Error Trace: pg_test.go:713
Error: Received unexpected error:
ERROR: unimplemented: extension "hstore" is not yet supported (SQLSTATE=0A000)
Test: TestPostgresHStoreQuote
FAIL
exit status 1
FAIL github.com/uptrace/bun/internal/dbtest 6.199s
+ docker-compose down -v
[+] Running 2/1
⠿ Container dbtest-postgres-1 Removed 1.3s
⠿ Network dbtest_default Removed
```

Bun should work without these features, but they are listed below for tracking:

- [ ] https://github.com/cockroachdb/cockroach/issues/38931
- [ ] https://github.com/cockroachdb/cockroach/issues/41522
- [ ] https://github.com/cockroachdb/cockroach/issues/41284

Jira issue: CRDB-22392

Epic CRDB-25316

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。