Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't use this shard together with crystal-mysql #3

Closed
Manu-sh opened this issue Sep 18, 2020 · 6 comments
Closed

can't use this shard together with crystal-mysql #3

Manu-sh opened this issue Sep 18, 2020 · 6 comments

Comments

@Manu-sh
Copy link

Manu-sh commented Sep 18, 2020

can't using this shard with crystal-mysql, while stefanwille/crystal-redis is not affect by this issue

Resolving dependencies
Fetching https://github.com/jgaskins/redis.git
Fetching https://github.com/jgaskins/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-mysql.git
Error shard name (db) has ambiguous sources: 'git: https://github.com/jgaskins/crystal-db.git' and 'git: https://github.com/crystal-lang/crystal-db.git'.
@jgaskins
Copy link
Owner

jgaskins commented Sep 18, 2020

This shard currently depends on my fork of crystal-db that allows its DB::Pool class to be used as a general-purpose connection pool since it's threadsafe. stefanwille/crystal-redis uses the ysbaddaden/pool shard which is not (I found this out the hard way running an app with -Dpreview_mt). More context on that here.

I submitted the branch this shard uses as a PR to crystal-db to allow DB::Pool to be used as a general-purpose connection pool and it just got merged a few days ago, so I should be able to update this shard to use that.

@Manu-sh Manu-sh closed this as completed Sep 18, 2020
@jgaskins
Copy link
Owner

It's okay, you don't need to close this, it's definitely a problem. 🙂

@jgaskins jgaskins reopened this Sep 18, 2020
@z64
Copy link

z64 commented Sep 19, 2020

@Manu-sh One way you may be able to get around this is to use shard.override.yml, available in shards v0.12:

$ shards --version
Shards 0.12.0 [218eb62] (2020-08-12)

$ cat shard.override.yml
dependencies:
  db:
    github: jgaskins/crystal-db
    branch: generic-pool

and re-run shards install.

@Manu-sh
Copy link
Author

Manu-sh commented Sep 19, 2020

@z64 thankyou for this information, maybe could be useful in future

@jgaskins
Copy link
Owner

@z64 TIL! This sounds like a much cleaner stopgap than what I ended up doing. I forked will/crystal-pg to have it use my fork/branch of crystal-db. I just installed shards v0.12 and will definitely use this! Thank you!

@jgaskins
Copy link
Owner

@Manu-sh crystal-db v0.10 has been released with support for a generic connection pool. I've updated shard.yml with that version in this commit so we should be good to go here.

@Manu-sh Manu-sh closed this as completed Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants