avito-tech/go-transaction-manager

Separate drivers

hound672 opened this issue · 9 comments

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).

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.

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).

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?

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?

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.

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)

@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 

#96

Looks good!
Thanks!

#96 Merged