feat: YDB support in XORM #2329
No reviewers
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#2329
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "datbeohbbh/xorm:pr-ydb-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi! I'm from YDB - an open source Distributed SQL Database. YDB application team know XORM is an ORM, which has rich features, supported multiple databases and think it would be great if XORM could also support YDB. I'm responsible for adding support for YDB in XORM.
I know it's a big PR, but most of it comes from tests. Below are some notes that I think might help with your review process.
review notes:
package
convert
NullDuration
type.package
internal/statements
Null
type.uint
,int
.package
schemas
IntervalType
,NullInt16Type
andNullTimeType
package
dialect
inDialect
interface, addIsRetryable(err error)
. When working with distributed system like CockroachDB, YDB, client can get an transient error due to network, services unavailable, ... . WithIsRetryable(err error)
method, database can evaluate anerror
and decide to retry or not.ydb.go
,filter.go
implementDialect
interface for YDB.package
retry
:a helper package, which provides method for back-off and retry base on error evaluate function.engine.go
:dumpTables
for YDBaddDo
andDoTx
, which utilizeIsRetryable(err error)
of database dialect implementation andretry
helper for retrying operations.package
tests
:ydbtest
: integration tests for YDB. The reason I did it is that, YDB does not support auto-increment primary keys, so the common tests of XORM will not work for YDB. (Note: Some tests are taken from the common tests of XORM).Please take your time to review. I am willing to make any modifications to match your standards. Thank you in advance!
@ -146,0 +150,4 @@
Start int
}
func ydbSeqFilterConvertQuestionMark(sql, prefix string, start int) string {
Why not reuse
postgresSeqFilter
? We can rename that filter and share it.I think, we should not share filter, in implementation of
postgresSeqFilter
it has cases forjsonb
question, but YDB does not have it. Although, use the share filter doesn't make conversion produce wrong result string, but in future, change in a share filter may affect other databases.a22b8b97a2
to1af993e08d
@ -0,0 +42,4 @@
- name: test ydb (insecure connection)
run: TEST_YDB_SCHEME=grpc TEST_YDB_HOST=ydb:2136 TEST_YDB_DBNAME=local make test-ydb
services:
@lunny can you please help me to check CI, currently,
test ydb
failed because of timed out, reason I think connection is hung up because it can not see YDB server (or YDB server is not exist??).1af993e08d
to066cbc3447
feat: YDB support in XORMto WIP: feat: YDB support in XORMTEST_YDB_CONNECTION_STRING
7b5ad47a18toYQLDataType
fa6b7cf885yqlToSQLType
71893ce644session_insert
(*Session) insertStruct
7ee431afcenull
value 31f21326e960b9392a34
to1acadcdf7d
WIP: feat: YDB support in XORMto feat: YDB support in XORM@ -55,6 +55,9 @@ Drivers for Go's sql package which currently support database/sql includes:
- [github.com/mattn/go-oci8](https://github.com/mattn/go-oci8) (experiment)
- [github.com/sijms/go-ora](https://github.com/sijms/go-ora) (experiment)
* [YDB](https://github.com/ydb-platform/ydb)
I think we can just it's experiment supported and we can improve it in future.
1acadcdf7d
tobb4f917e64
Checkout
From your project repository, check out a new branch and test the changes.