smootoo / freeslick Goto Github PK
View Code? Open in Web Editor NEWOpen source Slick drivers for commercial databases. Includes MS SQLServer, Oracle 11g and DB2.
License: Other
Open source Slick drivers for commercial databases. Includes MS SQLServer, Oracle 11g and DB2.
License: Other
Hi guys, are you using freeslick with Oracle in production?
Thks!
will require another branch
now that we have the custom docker image, we should be using Shippable as the build platform.
The configuration steps when using play-slick seem to be different than those listed for just using vanilla slick.
when I do
slick.dbs.default.driver="freeslick.MSSQLServerProfile"
I get
Caused by: slick.SlickException: Error getting instance of Slick driver "freeslick.MSSQLServerProfile.api"
at slick.backend.DatabaseConfig$.forConfig(DatabaseConfig.scala:65) ~[slick_2.11-3.1.0.jar:na]
at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.create(SlickApi.scala:89) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.get$lzycompute(SlickApi.scala:81) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.get(SlickApi.scala:80) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.DefaultSlickApi.dbConfig(SlickApi.scala:66) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.NamedDatabaseConfigProvider$$anon$1.get(SlickModule.scala:59) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.HasDatabaseConfigProvider$class.$init$(DatabaseConfigProvider.scala:180) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at dao.VisitorStatusDAO.<init>(VisitorStatusDAO.scala:14) ~[na:na]
at dao.VisitorStatusDAO$$FastClassByGuice$$df55dc6e.newInstance(<generated>) ~[na:na]
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40) ~[guice-4.0.jar:na]
Caused by: java.lang.ClassNotFoundException: freeslick.MSSQLServerProfile.api
at java.lang.ClassLoader.findClass(ClassLoader.java:530) ~[na:1.8.0_25]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_25]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_25]
at slick.util.ClassLoaderUtil$$anon$1.loadClass(ClassLoaderUtil.scala:12) ~[slick_2.11-3.1.0.jar:na]
at slick.backend.DatabaseConfig$.forConfig(DatabaseConfig.scala:63) ~[slick_2.11-3.1.0.jar:na]
at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.create(SlickApi.scala:89) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.get$lzycompute(SlickApi.scala:81) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.get(SlickApi.scala:80) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.DefaultSlickApi.dbConfig(SlickApi.scala:66) ~[play-slick_2.11-1.1.1.jar:1.1.1]
at play.api.db.slick.NamedDatabaseConfigProvider$$anon$1.get(SlickModule.scala:59) ~[play-slick_2.11-1.1.1.jar:1.1.1]
I get the same for 'freeslick.MSSQLServerProfile.api' and 'freeslick.MSSQLServerProfile.api._' and any other combination I can think of.
there is a possibly related issue here playframework/play-slick#333 which ends up being a problem in slick itself slick/slick#1152 but that fix should be merged so I dont think its what is causing my issue. I think I am just not understanding how to translate the freeslick config steps into the play-slick config steps
By authors own admission, this is stolen code.
Typesafe is planning to release Slick 3.1.0 in a week (http://slick.typesafe.com/news/2015/10/02/slick-3.1.0-RC3-released.html). When freeslick will have corresponding version? Is current one compatible with Slick 3.1.0?
I'm looking for a slick driver for MonetDB https://www.monetdb.org/Documentation/Manuals/SQLreference/Programming/JDBC
Is this something you'd be interesting in developing? I could help.
Doesn't do SQL 2000 or 2005, but has 2008+
http://www.appveyor.com/docs/services-databases
might be a lot easier than the docker approach.
looks like express versions are available!
I do not know if this is Freeslick issue, but I found out that following code does make changes in DB
val action = Table insertOrUpdate row
Await.result(database.run(action.transactionally), 2 seconds)
but same code without .transactionally doesn't
val action = Table insertOrUpdate row
Await.result(database.run(action), 2 seconds)
but both return 1 as number of affected rows.
Same issue is for delete-ing and update-ing, but read-ing works fine both ways.
Is this a bug in Freeslick or am I doing something wrong?
Having a Clob column in Oracle and trying to insert a string over 4000 chars long gives a
ORA-01461: can bind a LONG value only for insert into a LONG column
In the README we see "BSD and Apache OSS licenses allow such moves: this incident serves as a good reason for you to prefer Free Software licenses ...". However the BSD and Apache are Free Software licenses, at least according to the Free Software Foundation: http://www.gnu.org/licenses/license-list.html
I think instead you mean "copyleft license".
Typesafe announced that the Slcik Extensions (this are the Slick drivers for commercial databases) will become open source, just like the drivers for the open source databases.
We should check what we can push back upstream when this happens (of course depending on the license).
@davegurnell you promised, I heard you say it and everything ๐
Querying on view through a db link returns a ORA-00942: table or view does not exist
because of additional quotation marks.
Now query looks like:
select * from "link"."view_name";
but expected (working) version is:
select * from link.view_name;
Quick workaround is to create a proxy view as follows:
CREATE VIEW local_view AS SELECT * FROM link.view_name;
Tested on freeslick 3.1.1.1 with oracle 11.2.0.4.0
will require creating a branch for the 2.0.x release and travis setup
I just noticed that snapshots are not automatically published on merges to master https://oss.sonatype.org/content/repositories/snapshots/org/suecarter/
Is that intentional.
Also, when is the DB2 stuff going to hit central? :-) (or at least sonatype)
Travis may be able to do this, or somebody might offer a remotely hosted solution. There is a gratis MS-SQL edition.
We have a docker image which can start up a local MSSQL (and potentially other databases), allowing the integration tests to be automatically run against real servers as part of the Pull Request review process.
Unfortunately, in order to deploy the custom docker images we need root access on a network-enabled non-VPS host, that you will keep powered and connected to the interwebz, running Ubuntu Trusty so that we can use it as a dedicated host on shippable (must be non-VPS because we have virtualbox and virtual machines cannot be efficiently nested).
If you can help by donating the hardware, please get in contact!
Document that you also need this line in build.sbt
to make it work:
resolvers += Resolver.sonatypeRepo("snapshots")
I'm not sure if anyone actually uses it, but it might be interesting to check if everything works with
http://www.microsoft.com/en-gb/download/details.aspx?id=11774
Incase you've not seen the news, https://blogs.microsoft.com/blog/2016/03/07/announcing-sql-server-on-linux/
Till "returnInsertKey" will get support, what is the suggested way to get back the auto-incremented ID value after insert operation?
Seems that usage of OUTPUT is the way to go for such INSERTs, http://stackoverflow.com/questions/42648/best-way-to-get-identity-of-inserted-row
Assuming that there is table with Boolean field (MSSQL's BIT) when complex queries are generated, "case when..." statements are wrongly generated for queries with Boolean fields, like:
generates wrongly:
case when BOOLEAN_FIELD then 1 else 0
but expected would be something like:
case when BOOLEAN_FIELD = 1 then 1 else 0
I got this problem while doing left join on two tables, where one of them have 1 Boolean column
Exception:
Caused by: java.sql.SQLException: An expression of non-boolean type specified in a context where a condition is expected, near 'then'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) ~[jtds-1.3.1.jar:1.3.1]
...
I am trying to execute the following action using the OracleProfile:
db.run( ( items returning items.map( _.cdSID ) ) += newItem )
And I get the error:
slick.SlickException: This DBMS does not allow returning columns from INSERT statements
Is it because this feature is not supported yet or am I overlooking something?
I tried to do it with plain sql but I get a -1 as a result (no rows inserted). I don't know if it is the right approach but I will share it with you anyways:
implicit val setInstant: SetParameter[ByteArrayInputStream] = SetParameter { (stream, pp) =>
pp.ps.setBlob(1, stream)
}
val insertStatement = (i: Item) => {
val in = new ByteArrayInputStream(i.content.getBytes("ISO-8859-1"))
sqlu"""DECLARE transId CDBAN.TBAN_SOLICITUD.CDSID%TYPE; BEGIN INSERT INTO CDBAN.TBAN_SOLICITUD (CDSID, DSCONTENT) VALUES (null, $in) returning CDSID INTO transId; END;"""
}
db.run( insertStatement( item ) )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.