avito-tech / go-transaction-manager

Transaction manager for GoLang
MIT License
231 stars 14 forks source link

Separate drivers #75

Closed hound672 closed 9 months ago

hound672 commented 1 year ago

Hello. For now this github repository contains main functionality and drivers/plugins for different databases. Do you think about separated repositories? One with main functionality, and another for drivers/plugins (each for plugin: 1 for pgx, 1 for redis etc).

maranqz commented 1 year ago

Hello, I don't think about it, but it is a good idea. If you create a pull request with these changes, I'll be happy to review it.

hound672 commented 1 year ago

Ok, but now i'd like to implement pgx support, if you don't mind. I really like you approach. I made an approach that similar to yours (also use ctx to share transaction).

hound672 commented 1 year ago

I think that the main repository should contain only trm package and hence only basic deps. And for each adapters should be its own repository. But where? This space? What do you think?

maranqz commented 1 year ago

I think we can add go.mod to each adapter and store it all in the one repository. Creating repos for each adapter adds extra work.

Also I would check what will happen with the old code. Should version be bumped up to v2, or is it enough for the lib users to update go.mod?

hound672 commented 1 year ago

I think we can add go.mod to each adapter and store it all in the one repository.

Hm... go get https://github.com/avito-tech/go-transaction-manager/pgx for example to install pgx adapter?

version be bumped up to v2

I think yes, since it breaks current api.

maranqz commented 1 year ago

Hm... go get https://github.com/avito-tech/go-transaction-manager/pgx for example to install pgx adapter?

Yeap)

version be bumped up to v2

I think yes, since it breaks current api.

MAJOR version when you make incompatible API changes https://semver.org/ I'm not sure that we change API at all. I hope go mod tidy would be enough to update)

maranqz commented 10 months ago

@hound672 you can check

go get github.com/avito-tech/go-transaction-manager/trm/v2@v2.0.0-rc6
go get github.com/avito-tech/go-transaction-manager/drivers/pgxv4/v2@v2.0.0-rc6 

https://github.com/avito-tech/go-transaction-manager/pull/96

hound672 commented 10 months ago

Looks good! Thanks!

maranqz commented 9 months ago

96 Merged