Comments (10)
Hi,
I'm not sure it's play-slick specific problem
from play-slick.
In fact, it is. Check out the following file : Database.scala line 20
private def driverByName : String => Option[ExtendedDriver] = Map(
"org.apache.derby.jdbc.EmbeddedDriver" -> DerbyDriver
,"org.h2.Driver" -> H2Driver
,"org.hsqldb.jdbcDriver" -> HsqldbDriver
,"com.mysql.jdbc.Driver" -> MySQLDriver
,"org.postgresql.Driver" -> PostgresDriver
,"org.sqlite.JDBC" -> SQLiteDriver
,"com.microsoft.sqlserver.jdbc.SQLServerDriver" -> SQLServerDriver
).get(_)
When using log4jdbc, you have to use the net.sf.log4jdbc.DriverSpy
which results in a unknown driver exception
.
from play-slick.
I do not know log4jdbc enough: which Slick driver it should use, how should it behave? From looking at Slick there is no driver for log4jdbc, but I guess log4jdbc is just a proxy right?
NOTE: you can still use play-slick, but you have to figure out which driver to use on your own.
from play-slick.
Indeed, log4jdbc is nothing more than an jdbc proxy. In order to find the right driver, log4jdbc inspects the jdbc connection url in order to extract the used driver. To integrate this into Play-Slick, one should :
- Check the driver provided, if
net.sf.log4jdbc.DriverSpy
then go to 2. - Check the connection url and perform the same analysis log4jdbc does.
However, this seems to be a bit far-fetched for simple debugging. I suggest putting this on standby. I will take a look at this next week when I will have some more time.
from play-slick.
Sure. PRs are welcome! We are trying to get into Play20, so I am not sure if an eventual PR would make it directly, but we can see how we manage that when the times comes :)
from play-slick.
@iammichiel hey! I was just wondering if you had the time to make a PR happen?
from play-slick.
Indeed, I have tried a few things but it seems pretty hard to make something "clean". I'll let you know if it works out.
from play-slick.
Alright - cool that you have tried Just so it is said: I don't mind reviewing it and give feedback (I will be polite :) if you want to send in a PR. I can't test it though so I will have to rely on you for that...
from play-slick.
Should be fairly easy to set up a test for this. Would it be an option to make the slick driver configurable in the application.conf which would take priority to the driverByName? Or allowing the user to provide a different driverByName function by implementing some trait?
from play-slick.
I am not sure if one of you gave me that PR - but the PR that let's you configure the driver is now in and it should resolve this. Closing for now...
from play-slick.
Related Issues (20)
- Connections not being returned to pool on transaction failure HOT 10
- Cannot acquire connection on many "refresh"
- play 2.7 docs mention play-slick 3.0.0 HOT 2
- Restart connection pools when DB credentials expire HOT 2
- Bump Play version to 2.7.1 HOT 1
- Evolutions fails silently looping the `InvalidDatabaseRevision` for MySQL HOT 1
- Publish for Play 2.7 + slick 3.2? HOT 2
- Unique Indexes break referential integrity. HOT 2
- Evolution script is skipped if there is any Cyrillic character HOT 1
- Why not write Evolutions in Scala ?
- Evolutions are not completed when I access the database programmatically. HOT 15
- Update master Readme to show latest version 5.0.0 HOT 1
- At 5.0.0, Samples don't work HOT 6
- In Play 2.8.2, slick.dbs.default.profile config throws ClassNotFound exception when using custom Profile HOT 4
- Play evolutions throwing error when trying to run it for the first time HOT 10
- please release new version HOT 5
- Unsupported operations post upgrading to scala 2.12 HOT 1
- On startup, evolultion button to apply is disappeared HOT 6
- 6.0.0 Release? HOT 7
- please release new version with slick 3.5.0 final HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play-slick.